Fix thumbnails rotation issues

Rotated images generate unrotated thumbnails, that is because PIL doesn't copy
exif information when working with functions like resize or thumbnail