Note that even though the fact that the script breaks when an image is missing is the real bug here, this is related to bug 1166994.
Note that even though the fact that the script breaks when an image is missing is the real bug here, this is related to bug 1166994.