Vortex pinning vs superconducting wire network: origin of periodic oscillations induced by applied magnetic fields in superconducting films with arrays of nanomagnets