se $file è uguale a 1030N.jpg, $nome[0] è 1030N, il che in teoria è giusto.

prova a stampare la query

con echo $sql