easiest way i can think of is to not do dynamic images
have two images for each picture you want
img1.png img1_thumb.png
img2.png img2_thumb.png
...
...
page.php?picture=1
will then load
switch ( $_GET['picture'] ) {
case 1:
print 1 big : img1.png
print 2 and 3 small : img2_thumb.png img3_thumb.png
case 2:
print 2 big
print 1 and three small
case 3:
ditto
}
but i would suggest hand making thumbs of all images you want..
its possible to do it dynamically with the php [man]image[/man] functions but if you do that, don't do it every page load. if a specific image is needed to be loaded as a thumb on the side, check to make sure there is a thumb for it... if not dynamically create one and save it to that directory... that way is hands off but still won't use up too much processor time