Fix left over images

A defaultdict is used to store saved images, and new ones are created if they don't already exist in this dict, but due to threads, it happens than one image can be saved to different files more than once, though dict entry is overwritten because they have the same data (and therefore the same hash).