Re-implement cleanup command.

Remove thumbnails (file and database references) that no longer
references an existing source image.