Improved handling of binning and camera ROI.
Fixed some issues with setting ROIs and binning, also streamlined the code.