Resolves #7. Refactored the generation of the thumbnails out into an event listener