Moved auto rotation code out of controller and into model.
Applying auto rotation to base photo and not original.
Unit tests to cover cases when auto rotation is enabled and disabled.
Closes #1031
Closes #1149