How to match parent movieclip size to grid of child clips?

Hello all,

I’ve got a thumbnail grid which consists of dynamically created movieclips.
A custom scrollbar moves the grids parent’s y-axis behind a mask.

The grid has a fixed width, but a variable height (as number of thumbnails may change).

Now, I need to have the parent movieclip reflect the dimension of the entire grid in order for the scrollbar to work.

How do I do this?

Thanks!