Chemical composition dependent local lattice distortions and magnetism in high entropy alloys