Fix an upside down or sideways image