caching of images works correctly