Flex box with page break not working

Clash Royale CLAN TAG#URR8PPP
Flex box with page break not working
I have my example setup in this codepen.
Im trying to print a dynamic amount of images in a grid in a way that things don't get cut off at the bottom of each page. usings page-break-before seems like the easiest way to do things.
page-break-before
So every 5 cols I insert a break item
<div class="page-break"></div>
<div class="page-break"></div>
and the following css
@media all
.page-break display: none;
@media print
.page-break display: block; page-break-before: always;
But this seems to have no effect. I can't find anywhere that explicitly states it, but since this attribute does not work with floating elements, I'm assuming it wont work with flexbox either.
How else can I achieve what I'm looking for:
Being able to create a grid 5 columns wide dynamically, from an unknown number of items, that will work with the page-break attribute.
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.