The height matters because of the way css floats work. In your screen shot the first item in the first row is taller than the one to it's right, so the third item floats against the bottom part of the first item. This then pushes the document flow down to the bottom of the third item so the fourth item floats left under that, leaving a space above. The only way I found to resolve it , as has been said, is to use javascript to make them equal height then they all line up nicely. Another option would be to use javascript to lay them out so there are no gaps ( like Pinterest ), but I preferred the equal height approach.
Ian