thumbnailer plugin: Handle subdirectories appropriately.

This adds support to directories inside of the images directory for the thumbnailer plug-in. After this pull request, if there are subdirectories inside of the images folder these are also reflected appropriately in the generated thumbnails. This avoids naming conflicts between the same image name in multiple folders.