Flux Pinning and Microstructure in YBa2Cu3O7