Keep the direction of the chain code.

While we could certainly work it out ourselves from the returned list of
pixel positions, this makes it much easier at no real cost, we had the
data anyway.

We also remove the unused onImage function.