Effective vortex pinning in MgB2 thin films