Brains911 suggested what you really want. I interpreted your “photo” as 1 photograph (last) expanding in width, which is the original answer below. However, if you want the "photos" (plural, all 3) to expand, then there is a CSS3 answer that I added below.
Original answer (CSS2: only the last photo)
Add this below ibox css:
.ibox:first-child + .ibox + .ibox:last-child { width: 210px; }
It will only target ibox and change the width if there is 3 instead of 4. See the script where I had to change the width your cont to fit your fields, but you should get this idea.
Additional answer (CSS3: expand all 3 photos)
Change the standard width in the .ibox definition to what you want in 3 photos ( in my example script I used 137px ), then add this css for the 4 photos script:
.ibox:nth-last-of-type(4), .ibox:nth-last-of-type(4) ~ .ibox { width: 100px; }
It counts back from the end, and if there are 4 of them, it will start the style for 4 instead of the default value.
source share