In image.py, ensure input can be ndarray or MaskedArray (Klaus Zimmerman).
Masked 2-D arrays are handled automatically by the color mapping
framework, so they need to be passed through; but there is no
point in converting 3-D arrays into masked arrays because there
is no support for dealing with a mask in that case.