I was messing around with this code today and was able to get the widget to show HORIZONTALLY. Here is what I got and if you want to see it in action, visit
http://www.modificationnation.com/ and under the big banner in the center you will see random members then FRESH INK & MODS.
You will need to add your database info at the top and change DOMAIN.COM to your URL. It should work no matter what your seo url's are set to but I don't know for sure. I have it set up to pull the newest photos from the gallery. If you would like it to pull random simply change "order by id DESC" to "order by rand()"
I am no coder, so I will do my absolute best to help you if it doesn't work
Code:
$host = 'localhost';
$dbUser = 'DATABASE USER';
$dbPass = 'DATABASE PASSWORD';
$db = 'DATABASE NAME';
mysql_connect("$host", "$dbUser", "$dbPass") or die(mysql_error());
mysql_select_db("$db") or die(mysql_error());
ob_start();
$result = mysql_query("SELECT id,cat,bigimage FROM pp_photos order by id DESC LIMIT 8") or die(mysql_error());
print "<table align=\"center\" border=\"3\" bordercolor=\"black\" cellpadding=\"10\"><tr>";
while($row = mysql_fetch_array( $result )) {
print "<td><div align=\"center\"><a href=\"http://DOMAIN.COM/showphoto.php/photo/" . $row['id'] . "\"><img src=\"http://DOMAIN.COM/data/" . $row['cat'] . "/thumbs/" . $row['bigimage'] . "\" width=\"100px\" height=\"100px\"></a></div></td>";
}
print "</tr></table>";
$output .= ob_get_contents();
ob_end_clean();