Minor refactor, and spotted bug to fix; if H command given out of range coords, image remains transposed