split image by connectivity