For troubleshooting, please swap the row orders between the 5×7 rows and the 8×10 rows. So move the 5×7 rows above the 8×10 rows so the 8×10 rows are on the bottom.
Now re-run it. Let me know if it is still the 5×7 that doesn’t work correctly…. or if the issue moves to the 8×10 images now that they are on the bottom.