Polarization switching between parallel and orthogonal collective resonances in arrays of metal nanoparticles