Now handles image orientation flag