rotate images based on exif information

Closes #1847