Improved image caching