util img: add tests and fix ensureYXC

need to switch axes correctly.