Solo para añadir una cosa:
Esta funcion genera nombres aleatorios, asi simplemente se pone la función y se graban diferentes archivos cada vez:
Código PHP:
function random_str($size)
{
$randoms = array(
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, a, b,
c, d, e, f, g, h, i, j, k, l, m, n,
o, p, q, r, s, t, u, v, w, x, y, z );
srand ((double) microtime() * 1000000);
for($i = 1; $i <= $size; $i++)
$text .= $randoms[(rand(0,35))];
return $text;
}