Where is the photon getting energy to deviate from its path? 
If we make $\triangle$x really small, then in order to not break the Heisenberg uncertainty principle the photons will need to change momentum($\triangle$p), so where is it getting the energy to deviate? I know that wave function says that the position of the photon is probabilistic but still in order deviate wouldn't it need energy?

The photon that would have gone almost straight, would have required less energy than a photon that was detected in extreme right or left.
 A: Momentum is a vector. That vector is changed, not its magnitude. Otherwise we'd see a slit changing the wavelength of the photons. The change does cause a force on the barrier structure, but the barrier is not moving. If the barrier moved, there would be an energy transfer between photon and barrier, and the photon wavelength would change.
BTW, an interesting side effect of this fact is that if the barrier moved toward the source of photons, the resulting photons would have more energy.
A: It is all quantum mechanic, i.e the Heisneberg uncertainty principle (HUP) is within the framework of quantum mechanics, not of classical particles running along on straight tracks.
What does it mean for a single photon? It means if one measures the $x$ coordinate very accurately, the $p$ component uncertainty is constrained by the HUP. 
$ΔxΔp>h/{2π}$
The  HUP   says nothing about scattering, and the  changing paths that you draw.

In the above bubble chamber picture we see one photon ( a gamma) hitting an electron and coming out with a number of charged tracks. In bubble chambers the accuracy of measurements is microns, and the HUP is fulfilled automatically, as the accuracy of momentum measurement is in mev/c. The uncertainty in momentum will be within the measurement errors that will give the momentum of this gamma.
When a photon interacts, which it has to do if measured, it is then that one can check the HUP.
Edit:
Maybe you are confused by the virtual loops that can exist within the HUP envelope, of particle/antiparticle, in  vacuum . These because the particles are virtual the particle momenta are not on mass shell, and they continuously change under the integral that the loop represents. For momentum to change one needs a real interaction vertex, as the gamma electron scattering in the picture above.
A: The recoil energy is extremely small, but you are correct the in principle it is not exactly zero. The energy of the photon (eVs) is many orders of magnitude smaller than that of the slit system ($10^{26} $ eVs) . 
