Well, one way would be to use a name/value pair in the query string to pass which pic has been selected.
So
page.php?pic=1
would mean you should display pic #1
In that case, you just need to determine is $_GET['pic'] is empty or not:
//array of pic numbers corresponding to pic filenames
$pic_array (
'1' => 'apple.jpg',
'2' => 'balloon.jpg',
'3' => 'cat.png'
);
//check if $_GET['pic'] is empty, or if an incorrect value entered
if (empty($_GET['pic']) || !array_key_exists($_GET['pic'], $pic_array)) {
//display no pic
}
else {
//display pic based on corresponding $pic_array element
}