Had a good look for this both here and through google, not even sure I'm asking the right question.

I have a two table DB to store photos for myself and my family to view. One table stores the actual images (actually links) and the other stores categories. To view the pages I have a homepage with a drop down that then sorts by the category.:
http://www.incessant-logic.net/gallery/index.php that then hops to an index page that lists five images plus a paging sript to move on five images and back etc...:
http://www.incessant-logic.net/gallery/list.php?cat=2 .
Now here is where I'm having issues, I really want this page to look like my normal index page:
index page but have it assembled from the database rather than being static. I can display horizontally, or vertically but can't work out how to do both for
X number of records.
I found a tutorial on Codewalkers.com (
http://codewalkers.com/tutorials/15/1.html) that should work but doesn't, or I can't make it work. Can anyone recomend a different tutorial or guide that would help me crack this issue?
And I know there are easy to install/use gallery scripts but using one doesn't help me learn how to make my own.

But if anyone knows of one thats really easy to use that I could look at to how it works in practice that might be handy too.