Optimizing vortex pinning in YBa2Cu3O7-x superconducting films up to high magnetic fields