Sandro,
There are a few ways to do this. First you would create a querystring token called idXY within Tailored Text. This token woudl actually be a querystring token and not a Session token but either way you would create it. Next you would create a SQL token called MySQL and use something like
Select Text from YourTable where PictureId = '$(idXY)'
You have 2 options now:
1. If the text pulls in pictureA.gif you could use something like this in your HTML (use < and > after code below, otherwise it renders it as html)
img src="http://www.yoursite.com/portals/0/$(MySQL)"
Thats assuming it only returned picture1.jpg or whatever the file was
Option 2 would be assuming that your table either pulls in the entire URL to the image OR you could always pass the parameter to a stored procedure that would then return the full URL
example:
exec sp_getmyimageurl '$(idXY)'
Then have the stored procedure return something like this
Select 'http://www.yoursite.com/portals/0' + (Select Text from YourTable where PictureId = '$(idXY)')
Something like that, not sure the exact SQL above would work but that gives you an idea. You would basically just be returning the full URL.
Finally, if you used this option your image tag would just include the SQL token and not the full URL within the token. Something like this:
img src="$(MySQL)"
That should do it!
-Chad