Extended checks to prevent exceptions from non-square images when they
are rotated