Constraining unintegrated gluon distributions from inclusive photon production in proton–proton collisions at the LHC