added support for autorotate in thumbnails