Optimizing a Rydberg Atom-based Terahertz Imaging System