I’m having a similar problem. The container does not shrink even when the image is collapsed. I have tried it with multiple images and the container remains fixed at the maximum size even when the images are collapsed.
Collapsing, say, the first image results in the images shuffling up the page but the container stays the same size. I thought the container would adjust accordingly. but it doesn’t. Am I missing something?