creating a service to get and store images (needs to return a promise to use it)