Add caching for thumbnails