You’ve forgotten to include your HTML, and streamline your CSS in the CodePen. Remember that we only need the very basics to illustrate the layout issue – all the extra, cosmetic CSS for transitions, colours and hover effects, etc., aren’t really necessary here. Keeping the pen code small so that its easier for potential helpers to digest and focus their efforts on, will make helpful responses more likely. Help us to help you.
However, it sounds like you can put a
max-width on the image wrapper element and make it just wide enough to fit 5 images side-by-side.