It sounds like you want to keep a running total of where to position the image, and then adjust that at the same time that you show/hide the images. A crude version could be as follows:
Const imgStart AS Double = <SomeValue>
Const imgSpacing AS Double = <OtherValue>
Dim imgLeft AS Double
imgLeft = imgStart
With picImage1
If image1 Then
.Visible = True
.Left = imgLeft
imgLeft = imgLeft + .Width + imgSpacing
Else
.Visible = False
End If
End With
With picImage2
If image2 Then
.Visible = True
.Left = imgLeft
imgLeft = imgLeft + .Width + imgSpacing
Else
.Visible = False
End If
End With
With picImage3
If image3 Then
.Visible = True
.Left = imgLeft
imgLeft = imgLeft + .Width + imgSpacing
Else
.Visible = False
End If
End With
With picImage4
If image4 Then
.Visible = True
.Left = imgLeft
imgLeft = imgLeft + .Width + imgSpacing
Else
.Visible = False
End If
End With
With picImage5
If image5 Then
.Visible = True
.Left = imgLeft
imgLeft = imgLeft + .Width + imgSpacing
Else
.Visible = False
End If
End With
This uses imgLeft to track what the left position of the next image should be, and increments it by the Image Width, plus a spacer, each time it makes an image visible.
You could refine it using a loop to track things, and also by adding a vertical component: i.e. if imgLeft + .Width is greater than your desired page-width, then you increase an imgHeight variable and reset imgLeft = imgStart to begin another row of images