Support JPG extension correctly on thumbnails