Fixed image rotation bug in media files tab

Added general method for mime type thumbnail generation to use
identical thumbnails in media files tab and media gallery