Photo Gallery using XML and Flash - Question

OK so I have put this tutorial to work for me. I am finding when I try to mix vertical with horizontal it ends up overlapping images. If I do all vertical or all horizontal it’s fine. Any workarounds for this? Other than building a gallery for each orientation. :puzzled: