Space between box and footer

if i have a box with user inputted galleries, how can i attach the footer to box when there are no galleries inputted yet. I am having trouble getting the galleries to collapse within the box. Currently the box is very long with all the galleries, so when a user opens the page, they see a very long empty page. Does anyone know how to collapse/expand galleries in the box?

Not sure what you’re trying to acomplish

I have a gallery within a box element on a page. the gallery is hidden until user inputs photos into it. so in the editor the box is very long and i can only connect the footer to the box. therefor when the user sees the page it has a lot of empty space because they haven’t inputted any photos yet. I am trying to figure out if i can get the gallery to expand/collapse within a box element.