Have you tried using just a session ID with all the fields stored locally? Use the session ID as the key to find all the values, e.g. session ID is a column name in a database, or session ID is key of a tied hash. CGI::Session has a cookbook and a nice tutorial if you want to try it.
Also, why don't you use the "height" and "width" attributes in the <img> tag to create your thumbnail images? For example, the original image is 400x600, you could put a thumbnail using just the attributes, i.e. <img height="40" width="60" src="img.gif">. Unless you are doing other transformations with Magick, this may work a little faster for you.
What time is it? It's Camel Time!