add image processing function