feat: generate thumbnails for images stored in S3 and generate thumbnails with a maximum size (#5179)