Moved processing functions to image.py