Cosmological magnetic field limits in an inhomogeneous universe