Optimal generation of indistinguishable photons from non-identical artificial molecules