You could save the value of image[i, j] in an intermediate variable.