Change image Orientation enum to an int and other minor changes.