Added improved image caching