On-chip 3D culture systems that incorporate immune cells such as lymphocytes and stromal cells are needed to model immune organs in engineered systems such as organs-on-chip. Photocrosslinking is a useful tool for creating such immune-competent hydrogel cultures with spatial cell organization. However, loss of viability and motility in photocrosslinked gels can limit its utility, especially when working with fragile primary cells. We hypothesized that optimizing photoexposure-induced ROS production, hydrogel porosity or a combination of both factors was necessary to sustain cell viability and motility during culture in photocrosslinked gelatin-thiol (GelSH) hydrogels. Jurkat T cells, primary human CD4+ T cells and human lymphatic fibroblasts were selected as representative lymphoid immune cells to test this hypothesis. Direct exposure of these cells to 385 nm light and LAP photoinitiator dramatically increased ROS levels. Pretreatment with an antioxidant, ascorbic acid (AA), protected the cells from light + LAP-induced ROS and was non-toxic at optimized doses. Furthermore, scanning electron microscopy showed that native GelSH hydrogels had limited porosity, and that adding collagen to GelSH precursor before crosslinking markedly increased gel porosity. Next, we tested the impact of AA pretreatment and increasing gel porosity, alone or in combination, on cell viability and function in 3D GelSH hydrogel cultures. Increasing gel porosity, rather than AA pretreatment, was more critical for rescuing viability of Jurkat T cells and spreading of human lymphatic fibroblasts in GelSH-based gels, but both factors improved the motility of primary human CD4+ T cells. Increased porosity enabled formation of spatially organized co-cultures of primary human CD4+ T cells and human lymphatic fibroblasts in photo-crosslinked gels in a multi-lane microfluidic chip, towards modeling the lymphoid organ microenvironment. Some optimization is still needed to improve homogeneity between regions on the chip. These findings will enable researchers utilizing photocrosslinking methods to develop immunocompetent 3D culture models that support viability and function of sensitive lymphoid cells.