What will happen if we perform the Stern-Gerlach experiment on photons, will there be 1 beam based on zero spin or 1,2 based on polarization? So as we know the photon has zero spin so it shouldn't be splitted.. or could there be splitting for a changing magnetic field? 
 A: Careful: the photon has spin $1$ not zero. To be precise, it is an excitation of a spin-one massless field (the electromagnetic field).
The photon does not possess a magnetic dipole moment, so it will not be steered at all in a Stern Gerlach experiment based on a magnetic field gradient. However, one can arrange a version of the Stern Gerlach experiment tailored to photons. It would consist of an apparatus that scattered an incoming photon by an angle which depends on the direction of the spin of the photon. One could do this by deflecting a photon beam using a beam of suitably prepared atoms, for example. In such an experiment there will be two output beams of photons, not three, even though the photon has spin $1$. This is because for a massless field there is a further symmetry which prevents the spin from ever having zero projection on the direction of travel. As a result the photon can only have the eigenvalues $+\hbar$ or $-\hbar$ for the $\hat{S}_z$ operator. This is related to the fact that there are two not three linearly independent polarizations of the electromagnetic field at any given point. 
(To understand the quantum mechanical reason why the zero eigenvalue does not occur for photon spin components one requires a relativistic treatment; it is related to the fact that the mass is zero so one cannot find an inertial frame travelling faster than the photon and thus giving a different sign to the helicity.) 
A: The Stern-Gerlach experiment only splits particles based on their spin (or, more accurately, magnetic moment). Since photons have 0 magnetic moment, you will wind up with a single beam.
Note that you can split a beam based on polarization, but it wouldn't be a Stern-Gerlach experiment.
