Update img_proc.py

Cleaned up code, removed unused segments.