Localization of Dirac-like excitations in graphene in the presence of smooth inhomogeneous magnetic fields