It's hard to know your exact situation with out a comp of some sorts. I have had much experience dealing w/ grid style image galleries and have taken different approaches based on different scenarios. Usually I will go with the approach of floating block elements, usually a list of LI elements inside of a UL. When doing this you will want to give all of the LI elements a set width and height. This will allow them to wrap evenly and thus create a grid. Inside of each LI you can place your image tags and create your overlaying titles however you like.

I recently ran into an issue where the images had to have a variable height, so the solution ended up using a combination of "inline" and "inline-block" on the LI depending on the browser and not using float. This allowed the Images to display more like they would if they were in a table.

It's your personal coding preference if you would like to use the floating div, floating li, or table techniques as they all show the same result to the end user.

I personally prefer to use floating divs as the div tags are interchangable with a tags if you want those elements to be links (just add display:block; to the a tag). It also results the least amount of code out of the 3 options, and is the most flexible.

Oops, seems I forgot that you can use the the p tag also... it is interchangeable with the div tag technique, but will require display:block; in the CSS if you want the grid elements to have a set width and/or height whereas using divs will remove this need.

The Cross-Browser Inline-Block, told by Tim Correia is probably the best answer. But inline-block property doesn't have to be cross browser (another debate ?). It is now (and for the future) a good solution to use it (or another, according what you prefer, like display:table-cell)