Automatically generate thumbnails for large images