you can change this:
$destino = "img/perfil/".$imagem['name'];
to this:
$result = mysql_query("Select Nome from utilizadores WHERE ID='$id'");
$result = mysql_fetch_assoc($result);
$yourName = $result['Nome'];
$array = explode(".",$imagem['name']);
$destino = "img/perfil/".$yourName.".".end($array);
The explode()
is to get the image sufix.
You can set the name into the $yourName
variable