there's a simple way no-one seems to have thought of.
simply have images like this:
[ ====== ]
...where [ is the left, and ] is the right-hand 'end images', and = is the stretchable
image in the middle
then, simply stretch the dimensions of the middle image according to the data you have got.
repeat as necessary for multiple rows, or turn around for coloums.
::] krycek [::