jQuery masonry initializes failing on subsequent calls
===

I am experiencing something that I believe shouldnt be happening (based on other comments around the internet).

Basically the first time I call masonry() the layout is fine.

But if i re-emit new html content (for the masonry container) and then initialize it via masonry() again, then the layout is broken (just grid layout, but doesnt fill in all the spaces between items). 

On IE8 i actually get a jquery.masonry error via the debugger. 

- Am i doing something fundamentally wrong?
- Is there a better way to do this?

        var $container = $('#container');

        // emit photos.
        $container.html(content.join(''));

        // initiate masonry.
        $container.imagesLoaded(function() {
            $container.masonry({ // <<------------ this is where is crashed on subsequent attempts.
                    itemSelector: '.item',
                    isAnimated: true,
                    isFitWidth: true
                });            
        });