Updated code

works with image1 and image2 in the same directory