Mainform's image-capture logic needs to be separated into a new class that can be accessed by other weidgets.