Measuring gluon shadowing with prompt photons at RHIC and LHC