Re-projecting non-global images.

This PR is a bugfix for #358 and #359. It corrects the use of the `origin` keyword when an image needs to be re-projected and it prevents the nearest neighbour interpolation from extrapolating outside the domain of the original image.