Grid doesn't scale smoothly


I have a grid which doesn’t scale the way I want to. I want the grid to contain no more then 4 elements per row on the desktop. On the tablet and mobile landscape no more than 3/2 and on the mobile portrait just 1.

On the desktop view the whitespace is sometimes too big for my taste:

I have used the min/max settings on the grid. But don’t know if this is an elegant solution?

Does someone have a good solution for this?