Update the image after each iteration