Creation and annihilation of solitons in a ferromagnet with competing nonlinear inhomogeneities