Key role of lattice symmetry in the metal-insulator transition of NdNiO3 films