in reply to
Images, in links, in tables..... utter choas
Can you be a little more specific on what is going wrong? What are you seeing when you run it from the web? Do you have any errors from your server error log?
Update: I'm not sure exactly what is wrong, but you might consider dumping the CGI.pm html-printing stuff for your tables; it gets quite messy when used on tables.
Also, instead of saying $record, $record, $record, $record, you can use array slices and write it as @record[0..3].