I have the following code that saves an image but when it starts to save the next images it writes over the image that was already created. It does this 10 times and at the end I am left with one image and not 10 seperate images how can i fix this issue?

```
$album_id = $_GET['id'];
$url = 'http://website.com/xml/albums/site/'.$album_id.'/gallery/';
$xml = simplexml_load_file($url);

//album title and url
$album_title = $xml['title'];
$album_url = 'http://website.com'.$xml['html'];

//creates photo album directory
$thisdir = getcwd();
mkdir($thisdir."/".$album_id.' - '.$album_title , 0777);

//obtains all photos and saves them to a directory
foreach($xml as $xml_node) {
    $attributes = $xml_node->attributes();
    $file_url = 'http://website.com'.$attributes['src'];
    $file_name = $attributes['subtitle'];

    //save images
    copy($file_url, $thisdir.'/'.$album_id.' - '.$album_title.'/'.$file_name);

}

```

XML file

```
<photo src="/media/albums/1006969.jpg" title="Red" subtitle="01.jpg" />
<photo src="/media/albums/1006970.jpg" title="Red" subtitle="02.jpg" />
<photo src="/media/albums/100971.jpg" title="Red" subtitle="03.jpg" />
<photo src="/media/albums/1006972.jpg" title="Red" subtitle="04.jpg" />

```