flattenImages - How do I control the number of channels in the flattened images?