fix image segmentation