image orientation bug fix