The fundamental and optical gaps of relevant molecular systems are of primary importance for organic-based photovoltaics. Unfortunately, whereas optical gaps are accessible with time-dependent density functional theory (DFT), the highest-occupied - lowest-unoccupied eigenvalue gaps resulting from DFT calculations with semi-local or hybrid functionals routinely and severely underestimate the fundamental gaps of gas-phase organic molecules. Here, we show that a range-separated hybrid functional, optimally tuned so as to obey Koopmans' theorem, provides fundamental gaps that are very close to benchmark results obtained from many-body perturbation theory in the GW approximation. We then show that using this functional does not compromise the possibility of obtaining reliable optical gaps from time-dependent DFT. We therefore suggest optimally tuned range-separated hybrid functionals as a practical and accurate tool for DFT-based predictions of photovoltaically relevant and other molecular systems.