updated image caching approach