Fix for a image orientation bug