Generalize the gantry tilt code, fix spacing if needed.

The unshearing code expected the matrix to simply slide the slices,
and not to adjust the spacing.  However, depending on the length of
the z vector in the matrix, some spacing adjustment might be necessary.