still using nodejs check out
tiddlywiki.files and tiddlywikifolders as a way to manipulate files. tiddlywiki.files in particular will allow you to have tiddlywiki load a folder, apply a tag to everyfile in it automatically, and then you could have a tiddler that loads all files (such as images) based on that tag. All this is very much easier said then done if you are just starting out with nodejs but it's well worth the time. Nodejs unlocks some very powerful features, especially when it comes to file manipulation.