Added image caching properly