The images loaded within a collection aren't confined to the parent containers because, by default, images load at their intrinsic (original) size. Without any CSS constraints, they'll simply display as large as their pixel dimensions allow, potentially exceeding the boundaries of their parent.
max-width: 100% forces the image's width to be no larger than the parent's width, effectively containing it.
Before:

After:
