COD: comments and write corrected image to file