Update ImgProc.py

Broke up main function into sub-functions.