Fix image thumbnail deletion to remove only needed files