Better handle image orientation