Images are not stored within an app. They are stored in folders like any other file on any computer system, and those two apps just pull the info from those file to display. It's no different than using a photo viewer on your computer, only it's more streamlined because they automatically scan and show you the various folders (aka albums) containing the photos to eliminate you having to manually browse to them.
If you have any more questions, please register an account here so you can reply to your thread and get more detailed assistance.