Added support for NChannelImage and ExtendToNChannel

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

What are the implications of changing the pattern_sampler like this? Is it deliberate?