OCR not stable after running for few times

I’ve run the code a few times and have this “image not found” OCR error. Error was resolved when I captured the image from the pdf file again but the same error will occur if I run it for few times. It seems that the captured image only work for the first few times. Any suggestions to solve this?