Added realocation of space for ndarray on conversion of 3 channels to 4 and 4 to 3. Now setting the vglimage to desired number of channels