Why has the last row in CollectionView different spacing?

I played a bit with the match game replacing the cards with my own pictures. They are all squares now at 150 x 150 points. For some reason I get 4x4 rows but the last row has got smaller spacing between the cards. Why is that?

Most probably because the same settings that you are applying to the previous rows are not applied to the final one. Look at your loop where the rows are created.