Thanks for the quick reply.
I have done as suggested but now the page just floods with code if you look at the live page,
The first lines of my my code now read
<?php
ini_set("memory_limit", "256M")
?>
$resizeDir = getcwd();
chdir(dirname(__FILE__));
require_once("../framework/library.php");
chdir($resizeDir);
if (!class_exists("PG_CachedResize_Image")) {
if (!function_exists('mkdir_recursive')) {
function mkdir_recursive($pathname)
{
$old = umask(0);
is_dir(dirname($pathname)) || mkdir_recursive(dirname($pathname));
$retVal = is_dir($pathname) || @mkdir($pathname, 0777);
umask($old);
return $retVal;