Added support for NChannelImage and ExtendToNChannel


Sorry for all the previous open/close pull requests. This is the only merge to look at.

This needs documenting, as the code for it below looks very obscure.  It might not make sense here, and perhaps could move to RGBImage where it might be motivated better; but it could stay here if you could imagine some possible way this might make sense to do for n-channel images in general.