Magnetic particles guided by ellipsoidal AC magnetic fields in a shallow viscous fluid: Controlling trajectories and chain lengths