I'm working on a website where users can upload images. To ensure fast loading times on the image overview page, the application automatically creates a thumbnail of every image that is uploaded to the site.
Right now, I have it set so it will always create the thumbnail in the JPG format, mostly to make the files smaller. However, that approach has at least one drawback: JPG doesn't support transparency, so when a user uploads a PNG file that makes use of transparency, the thumbnail might look weird and the user might not be able to find the image in the gallery at a glance.
That led me to this question: why not just use the same format for the thumbnail as the original image? That way I can make sure that the thumbnail looks pretty much like the image the user uploaded. (Thinking about it, it could even support animated GIFs, though I'm not sure if that's a good idea). The downside of that approach would be that the file size might be higher, resulting in a worse user experience with the site.
As I'm writing this question, I'm beginning to feel like the second approach would be the one to prefer, but I'd still like to ask some other webmasters for input. What other technical reasons are there for using the same format for the thumbnail as the original image, or for simply using a fixed image format for all thumbnails?