Hola,
El problema está en la función, en las líneas:
imagejpeg($thumb,'thumb.jpg',90);
return '<img border="0" src="thumb.jpg" width="200" height="150">';
ya que el nombre de la imagen miniatura 'thumb.jpg' siempre es el mismo, con lo cual todos los <a href....> están referenciando este nombre.
Prueba por ejemplo así:
Código PHP:
function mini ($imagen) {
static $var=0;
if (filesize($imagen) < 500000) {
$original = imagecreatefromjpeg($imagen);
$thumb = imagecreatetruecolor(200,150);
$ancho = imagesx($original);
$alto = imagesy($original);
imagecopyresampled($thumb,$original,0,0,0,0,200,150,$ancho,$alto);
$dst_imagen='thumb'.$var.'.jpg';
imagejpeg($thumb,$dst_imagen,90);
$var++;
return '<img border="0" src="'.$dst_imagen.'" width="200" height="150">';
}
else {
return '<img border="0" src="'.$imagen.'" width="200" height="150">';
}
}