modify GenTestImage and ReadImage