change
$thumburl = "http://url of image file";
$thumb = file_get_contents($thumburl);
$space = $_POST['thumb']['size'];
move_uploaded_file($_POST['thumb']['tmp_name'], $config['TMP_DIR']. '/thumbs/' .$thumb);
@chmod($config['TMP_DIR']. '/' .$thumb, 0644);
to:
$thumburl = "http://url of image file";
$thumbContent = file_get_contents($thumburl);
$thumb = tempnam($config['TMP_DIR'] . '/thumbs/', 'FOO');
file_put_contents($config['TMP_DIR'] . '/thumbs/' . $thumb, $thumbContent);
@chmod($config['TMP_DIR'] . '/thumbs/' . $thumb, 0644);