Correlation between site preference, superconductivity and magnetism in Pb2Sr2Y1-xCax(Cu1-yMy)3O8 (M=Fe, Co, Ni, Zn, Ga)