Item13008: improve rendering thumbnails

- only render the first frame of a gif animation generating thumbnails
- fix orientation of thumbnail as specified in the EXIF metadata