Best answer came from: http://refreshmentwars.blogspot.co.uk/2014/01/recompile-php-with-bundled-gd-library.html
If you run into any source not found issues, don't forget to uncomment src lines in /etc/apt/sources.list
Be aware this took several hours to run for me and then failed when running mysql tests, it looks it like tried to create tables locally as part of its tests.
Install build tools required to compile source code
apt-get install build-essential debhelper fakeroot
Obtain the PHP source code
sudo apt-get source php5
Install all dependencies required to build PHP5
sudo apt-get build-dep php5
Build the package
cd php5-x.x.x (replace 'x' correct version number)
sudo dpkg-buildpackage -rfakeroot
This will take some time. When the .deb is compiled, traverse back a folder.
Install the required package*
sudo dpkg -i php5-gd_5.x.x.x.deb
*Don't forget to restart apache.