Spin and lattice dynamics in the two-singlet system Tb3Ga5O12