When the list of posts with attachments is being processed, those that cannot be converted are left in the list after each pass rather than having some kind of exclusion mechanism. If the attachment cannot be converted on the first pass, it is not likely to be converted on subsequent passes. Eventually those unconvertable images will fill the list. The starting post ID can be changed to exclude them, but it would be better if they could be held in a temporary table to be excluded from the next set of posts with IMG bbCodes in them.