Potentials for almost Markovian random fields