Tweaked calibration so that it can loop over multiple pictures, minor other changes.