I am trying to place a variable (1-4) number of items in a box.

I have an image, text and a box grouped together.
There will be 1-4 of these, and I am trying to space them out (similar to center text for 1-4 words of a text line).

ie..
_X_X_X_X
_X__X__X
_X_____X
____X

Using conditions I can make the groups visible or not, but the spacing I can not quite figure out.

I have tried snapping points but did not have much luck. I've started looking at presstalk, but have not gotten very far.

Any suggestions are appreciated!
Thank you!