Factoriality and Néron-Severi groups