it's hard to tell exactly what you;re doing because there is not a lot of context code there to go by....can you show how you are looping through your image files (the code)?
But maybe something like this?:
$images.="<a href=\"$_url/image.php?u=galleries/$_GET[folder]/$file\" target='_blank'><img src=\"$_url.$gallery_path$_GET[folder]/tn-$file\"></a> \n";
if ($file == "somefile.jpg")
$images.="<br>".$quote."<br>"; // Insert HTML $quote here