Manipulating the photon avalanche process through control of magnetic light