Theoretical Exploration of Terahertz Single-Photon Detection and Imaging by Nonlinear Optical Frequency Up-Conversion