Correctly render 2D deformed images.

Previously, the Z array had NaNs for 2D images.  This fails when the Z
term is used in a coordinate transform, as in attract and repel.