Dynamical matching of Josephson vortex lattice with sample edge in layered high-Tc superconductors: origin of the periodic oscillation of flux flow resistance.