Periodic vortex pinning with magnetic and nonmagnetic dots: The influence of size