A kilopixel array of superconducting nanowire single-photon detectors