I would use the following layout:
For uneven amount of pictures (5, for example), I would display like this

For situations when only 4 pictures exist, I would display like this

For situations when only 2 pictures exist, I would display like this

The reason to choose this layout is based on the fact that the images are centered in relationship with other visual elements like the side arrows and the button you have below the images, so all the content comes from the center point of the grid.
All images would have the same size in terms of columns so there is no misunderstanding by the user to think that if some images are larger than others, they might be important/more relevant.