Measurement of the Higgs boson mass from the H -> gamma gamma and H -> ZZ* -> 4l channels in pp collisions at center-of-mass energies of 7 and 8 TeV with the ATLAS detector