Thin-film polarizer made of heterogeneous medium with uniformly oriented silver nanoparticles