generate thumbnails and cache them to enhance performance when listing
directory