fixes a bug reported on the imageJ forum
apparently array.length bugs, see http://forum.imagej.net/t/biop-channel-tools-advanced-montage-issue/9445