Photo Upload site help, Got an error

Theres a php error for my upload.php page of my beta look here http://upfoto.us/upfoto_beta2/upload.php or here is the code.

<html>
<head>
<title>Upfoto - Free Image Hosting - Beta Testing</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<style type="text/css">
<!--
body {
    background-color: #5D98BD;
}
.style1 {
    font-size: 36px;
    color: #000000;
    font-family: Arial, Helvetica, sans-serif;
}
.style5 {font-family: "Times New Roman", Times, serif; font-size: 13px; }
-->
</style></head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<!-- ImageReady Slices (imagehosting.psd) -->
<table width="100%" height="100%" border="0">
  <tr>
    <th align="center" valign="middle" scope="row"><table id="Table_01" width="810" height="561" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td colspan="7"><img src="images/index_01.gif" alt="" width="809" height="33" border="0" usemap="#Map"></td>
        <td><img src="images/spacer.gif" width="1" height="33" alt=""></td>
      </tr>
      <tr>
        <td colspan="2" rowspan="2"><img src="images/index_02.gif" width="246" height="132" alt=""></td>
        <td colspan="5"><img src="images/index_03.gif" width="563" height="9" alt=""></td>
        <td><img src="images/spacer.gif" width="1" height="9" alt=""></td>
      </tr>
      <tr>
        <td colspan="3"><table width="548" height="123" border="0" background="images/index_04.gif">
            <tr>
              <th width="542" scope="row">&nbsp;
                </th>
            </tr>
        </table></td>
        <td colspan="2"><img src="images/index_05.gif" width="15" height="123" alt=""></td>
        <td><img src="images/spacer.gif" width="1" height="123" alt=""></td>
      </tr>
      <tr>
        <td colspan="7"><img src="images/index_06.gif" width="809" height="52" alt=""></td>
        <td><img src="images/spacer.gif" width="1" height="52" alt=""></td>
      </tr>
      <tr>
        <td rowspan="4"><img src="images/index_07.gif" width="101" height="343" alt=""></td>
        <td colspan="2"><table width="100%" height="314" border="0" bgcolor="#F6F6F6">
            <tr>
              <th align="left" valign="top" scope="row"><p><?php
    $file_count = 0;
    foreach($FILE['userfile']['error'] as $key => $value){
        $file = array(
            'name' => $FILE['userfile']['name'][$key],
            'size' => $FILE['userfile']['size'][$key],
            'tmp' => $FILE['userfile']['tmp_name'][$key],
            'error' => $FILE['userfile']['error'][$key],
            'rand' => str_shuffle(strtolower(substr(base64_encode(md5(base64_encode(rand().rand()))), 0, 20)))
        );
    
        if($file['error'] != 4){
        
            $file_count++;
            if($file_count >= 2){
                echo "<br><div class='divider'></div><br>
";
            }

            $extension = file_type($file['name']);
            $filename = $file['rand'].".".$extension;
            $uplogs_file = fopen("./logs/upload_logs.txt", 'ab');

            if($CONFIG['path'] == $CONFIG['tpath']){
                generror(file_handling_error('12')." - File: \"".$file['name']."\"");
            }elseif(!is_dir($CONFIG['path'])){
                generror(file_handling_error('13')." - File: \"".$file['name']."\"");
            }elseif(!is_dir($CONFIG['tpath'])){
                generror(file_handling_error('14')." - File: \"".$file['name']."\"");
            }elseif(!is_writable($CONFIG['path'])){
                generror(file_handling_error('15')." - File: \"".$file['name']."\"");
            }elseif(!is_writable($CONFIG['tpath'])){
                generror(file_handling_error('16')." - File: \"".$file['name']."\"");
            }elseif(strlen(file_get_contents($file['tmp']))<1){
                generror(file_handling_error('21')." - File: \"".$file['name']."\"");
            }elseif(!in_array($extension, $CONFIG['allowed'])){
                generror(file_handling_error('9')." - File: \"".$file['name']."\"");
            }elseif($file['size']>$CONFIG['max_size']){
                generror(file_handling_error('10')." - File: \"".$file['name']."\"");
            }elseif($file['error']>0){
                generror(file_handling_error($file['error'])." - File: \"".$file['name']."\"");
            }elseif(file_exists($CONFIG['path'].$filename)){
                generror(file_handling_error('11')." - File: \"".$file['name']."\"");
            }elseif(!$uplogs_file){
                generror(file_handling_error('17')." - File: \"".$file['name']."\"");
            }elseif(!fwrite($uplogs_file, $filename." ".$SERVER["REMOTE_ADDR"]." ".date('D M d, Y g:i a')."
")){
                generror(file_handling_error('18')." - File: \"".$file['name']."\"");
            }elseif(!move_uploaded_file($file['tmp'], $CONFIG['path'].$filename)){
                generror(file_handling_error('19')." - File: \"".$file['name']."\"");
            }elseif(!chmod($CONFIG['path'].$filename, 0777)){
                generror(file_handling_error('20')." - File: \"".$file['name']."\"");
            }else{
                createthumbs($CONFIG['path'].$filename, $CONFIG['tpath'].$filename,$CONFIG['thumb_w'],$CONFIG['thumb_h']);
                fclose($uplogs_file);
                display_results();
            }
        }
    }

    if($file_count == "0"){
        generror(file_handling_error('24'));
    }

    
?>&nbsp;</p>
                </th>
            </tr>
        </table></td>
        <td rowspan="3"><img src="images/index_09.gif" width="27" height="331" alt=""></td>
        <td colspan="2"><table width="235" height="314" border="0" bgcolor="#F6F6F6">
            <tr>
              <th width="229" align="center" valign="middle" scope="row"> <script type="text/javascript"><!--
google_ad_client = "pub-0889424004863235";
google_ad_width = 200;
google_ad_height = 200;
google_ad_format = "200x200_as";
google_ad_type = "text_image";
google_ad_channel = "";
google_color_border = "F6F6F6";
google_color_bg = "F6F6F6";
google_color_link = "3D81EE";
google_color_text = "000033";
google_color_url = "003366";
//-->
</script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>&nbsp;
                </th>
            </tr>
        </table></td>
        <td rowspan="2"><img src="images/index_11.gif" width="10" height="320" alt=""></td>
        <td><img src="images/spacer.gif" width="1" height="314" alt=""></td>
      </tr>
      <tr>
        <td colspan="2"><img src="images/index_12.gif" width="436" height="6" alt=""></td>
        <td colspan="2"><img src="images/index_13.gif" width="235" height="6" alt=""></td>
        <td><img src="images/spacer.gif" width="1" height="6" alt=""></td>
      </tr>
      <tr>
        <td colspan="2" rowspan="2"><img src="images/index_14.gif" width="436" height="23" alt=""></td>
        <td colspan="3" rowspan="2"><img src="images/index_15.gif" width="245" height="23" alt=""></td>
        <td><img src="images/spacer.gif" width="1" height="11" alt=""></td>
      </tr>
      <tr>
        <td><img src="images/index_16.gif" width="27" height="12" alt=""></td>
        <td><img src="images/spacer.gif" width="1" height="12" alt=""></td>
      </tr>
      <tr>
        <td><img src="images/spacer.gif" width="101" height="1" alt=""></td>
        <td><img src="images/spacer.gif" width="145" height="1" alt=""></td>
        <td><img src="images/spacer.gif" width="291" height="1" alt=""></td>
        <td><img src="images/spacer.gif" width="27" height="1" alt=""></td>
        <td><img src="images/spacer.gif" width="230" height="1" alt=""></td>
        <td><img src="images/spacer.gif" width="5" height="1" alt=""></td>
        <td><img src="images/spacer.gif" width="10" height="1" alt=""></td>
        <td></td>
      </tr>
    </table></th>
  </tr>
</table>
<!-- End ImageReady Slices -->

<map name="Map"><area shape="rect" coords="14,5,61,30" href="#"><area shape="rect" coords="68,7,118,30" href="#"><area shape="rect" coords="128,5,188,30" href="#"><area shape="rect" coords="197,4,253,29" href="#"></map></body>
</html>