Fix handling of non-square pixels, part 1.