Cleaned up Image Processing Code
OOPified the entire thing