Constraining resonant photon-axion conversions in the Early Universe