Hi !
It is rather difficult to answer you if every time you give us bits of information.
Try to explain what exactly you want to do, how you go about it, shows some snippets of code and a sample content of your section [thumbnail], so we can understand the context.
This may be vast, the use of thumbnails.
For a pictures gallery: Only with the template? On a separate HTML page? With a Flash applet, Java? in Ajax scripting?
Could you use thumblists XML? ...
Have an idea of the program that you use to generate the thumbnails can be useful to develop a strategy for the script, to distrib the result.
For your troubles with variables, know the context of use can help to understand why, and most certainly how integrate them into a script.
%folder%, %item-name%, %folder%%item-name%.xxx, %item-ext%, %item-resource% ...etc
The [thumbnail] section, if it behaves like a HTML page, may restrict the use of variables.
It is much easier to consider the wishes of users, if we do not have to guess them.
So, if you can tell us more ...