Code:
$result = $db->query_read("
SELECT
imgurl
FROM
oftw_nominations
ORDER BY
id
ASC LIMIT 7
");
$output = '<div id=lightboximages class=blockbody>
<form cellpadding=10 border=1 action=oftw_insert_vote.php method=post>
<tr>';
foreach($result as $key => $row)
{
$output .= '<td><center>' . $key . '.<input type=radio name=votes value=' . $key . '><a href=testlightbox.php?id=' .$key. ' rel=Lightbox_1 id=image'. $key .'1><img src ='.$row.' style=vertical-align:middle;padding-bottom:5px;></a></center></td>';
};
$output .= '</tr>
<center><input type=submit name=submitvote style=width:70px;></center>
</form>
</div>';
echo "$output";
I don't know about how many querys are to many. But you can shrink them down in your code. Same goes for the echos.
sidenote:
http://www.php.net/ is a great source for php functions. =)