Why mysql fetch doubles the ammount

Hi i have this while fetch query which brings up a images from the database but know i tried to add a delete link in each image so i add a delete hyperlink inside the query but instead counts the link as if it was a image too. like if i have 5 images it will double to 10 because of the delete hyeprlink why is this happen help please


define('ROOT_DIR', './');
define('PROPER', TRUE);

/**
* include common files
*/
include_once(ROOT_DIR. 'includes/common.inc.php');



?>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<link href="css_eurico/lightbox.css" rel="stylesheet" type="text/css" />
<link href="css_eurico/jquery.lightbox-0.5.css" rel="stylesheet" type="text/css" media="screen" />
<script type="text/javascript" src="js_eurico/jquery.js"></script>
<script type="text/javascript" src="js_eurico/jquery.lightbox-0.5.min.js"></script>



<script type="text/javascript">

$(function() {

$('#gallery a').lightBox();

});

</script>


</head>

<body>

<?php
$album_id = $_GET['albums'];
 

$photo = mysql_query("SELECT * FROM photos WHERE album_id='$album_id'");


 echo '<div id="menu">';
while ($row = mysql_fetch_assoc($photo))

 {
 
     
     echo '<div id="gallery">';    
        echo'<div class="Image">';
    
        echo '<a href=photos/thumbs/'. $row['photo_proper'] . '  "><img class="picture" src="photos/' . $row['photo_proper'] . ' " width="100"  height="100 " /></a>';
        echo '<h4 class="brand">' . $row['photo_name'] . '</h4>';
          
             

        echo '</div>';
            
             echo '<a href="index.php">alo</a>';
    
}

?>

 </div>
  </div>


</body>
</html>

what does it do if you just ran the sql statement alone in PHPMyAdmin or your SQL admin tool.

Help please!!

ok i realised that because i have the $(‘#gallery a’).lightBox(); which is for pick up any link inside the div gallery and link to JQuery LightBox pop box now i have tried to move the delete link outside the div gallery by closing the div tag before the link but now the JQuery LightBox only picks the first image of the while fetch i think messed up the div’s can someone help so that i want the while fetch pick up all the images but keep the images inside the galery div i also need the while fectch to add a link to all images but outside the div gallery