This is strange. I set up the script according to the instructions on the demo page with no modifications. Worked fine in IE but, I had the same problem you had with one of the divisions causing a big gap to occur in FF. I looked through the code and tried a few things. This worked - I put one other division around the divisions that have the class of 'gallerycontent' and set its overflow to hidden, like this (code added to the demo is in red):
I even doubled the number of 'gallerycontent' divisions and it was still fine. It should work for you too.
<div class="gallerycontent" subject="What is DHTML?">