gallery caching