made a separate class for caching images