Transfer of atomic mass with a photon solves the momentum paradox of light