Correlation between stoichiometry, strain, and metal-insulator transitions of NdNiO3 films