The second peak effect and vortex pinning mechanisms in Ba(Fe,Ni)2As2 superconductors