Added main image processing logic
Finished with logic