This error seems to be related to PIL.
Is this particular image still opened in another process or did you just write to the file without a flush?
Also, did you (accidentally) imported Image instead of from PIL import Image?