wrote functions to image stitcher