Fixed some bugs in ImageSegmentor and added scaler