Implement sigma clipping in measure_image()