Voir aussi l'instruction 'with' avec quelque chose comme:

with Image.open(directory + file) as image:
try:
image.load()
except IOError:
shutil.copy2(directory + file, directorysave+...