Re-implement cleanup command.

Remove thumbnails (file and database references) that no longer
references an existing source image.
Merge pull request #312 from jorabra/new-cleanup-command

Re-implement cleanup command.