Adding image processing code