Any number of things could be done, my personal fav would be braking some of your rules but simply calculate the width of the screen at start up, and use some math count how many images can display:
if (TotalWidth - imageWidth1 - imageWidth2 - imageWidth3) <= 0 { 3 image center}
elseif (TotalWidth - imageWidth1 - imageWidth2) <=0 { display 2 image center)
else {display 1 image Center}
Note: another answer has better pseudo code for the full effect.
This would give a tossed photo look with the current setup and would scale to different device sizes.
Excluding that you could..
Calculate the predominant color and display an image off that.
Having tags for the images could put in a context sensitive image.
Total the color/brightness of all images and display something on that.
Display comments about images using the above rules tags for content and color/brightness levels.
You would probably want to randomize the padding image's to make them pre-or-post. There should be a lot of images or it will be like the grass comment repetitious noise.
You could also do a picasa/Google+ like effect and take the brightest/darkest or off some other equation and use it as the background this would give interest to the blank areas and be highly dynamic. This would be my second fav one, probably used in conjunction with my first, it also helps tie the "most visually different" with the others.