Whenever corrupt.py is restarted, it starts at the beginning and must loop through all of the previous images it has scanned,, comparing in the local database to see if it has seen it. This could conceivably have negative consequences (time and local database queries) as it processes increasingly large image sets. Perhaps some sort of a counter should be created where it counts how many times it has identified that it has seen an image previously so that it could skip the database queries on the next run?
This, of course, would be a parameter configurable at runtime as it is also conceivable that re-checking everything would also be desired at times.