diff --git a/home/default_platform_document/audiocomment.gif b/home/default_platform_document/template_thumb/audiocomment.gif
similarity index 100%
rename from home/default_platform_document/audiocomment.gif
rename to home/default_platform_document/template_thumb/audiocomment.gif
diff --git a/home/default_platform_document/checklist.gif b/home/default_platform_document/template_thumb/checklist.gif
similarity index 100%
rename from home/default_platform_document/checklist.gif
rename to home/default_platform_document/template_thumb/checklist.gif
diff --git a/home/default_platform_document/compare.gif b/home/default_platform_document/template_thumb/compare.gif
similarity index 100%
rename from home/default_platform_document/compare.gif
rename to home/default_platform_document/template_thumb/compare.gif
diff --git a/home/default_platform_document/courseobjectives.gif b/home/default_platform_document/template_thumb/courseobjectives.gif
similarity index 100%
rename from home/default_platform_document/courseobjectives.gif
rename to home/default_platform_document/template_thumb/courseobjectives.gif
diff --git a/home/default_platform_document/coursetitle.gif b/home/default_platform_document/template_thumb/coursetitle.gif
similarity index 100%
rename from home/default_platform_document/coursetitle.gif
rename to home/default_platform_document/template_thumb/coursetitle.gif
diff --git a/home/default_platform_document/cyclechart.gif b/home/default_platform_document/template_thumb/cyclechart.gif
similarity index 100%
rename from home/default_platform_document/cyclechart.gif
rename to home/default_platform_document/template_thumb/cyclechart.gif
diff --git a/home/default_platform_document/description.gif b/home/default_platform_document/template_thumb/description.gif
similarity index 100%
rename from home/default_platform_document/description.gif
rename to home/default_platform_document/template_thumb/description.gif
diff --git a/home/default_platform_document/diagram.gif b/home/default_platform_document/template_thumb/diagram.gif
similarity index 100%
rename from home/default_platform_document/diagram.gif
rename to home/default_platform_document/template_thumb/diagram.gif
diff --git a/home/default_platform_document/empty.gif b/home/default_platform_document/template_thumb/empty.gif
similarity index 100%
rename from home/default_platform_document/empty.gif
rename to home/default_platform_document/template_thumb/empty.gif
diff --git a/home/default_platform_document/flash.gif b/home/default_platform_document/template_thumb/flash.gif
similarity index 100%
rename from home/default_platform_document/flash.gif
rename to home/default_platform_document/template_thumb/flash.gif
diff --git a/home/default_platform_document/template_thumb/index.html b/home/default_platform_document/template_thumb/index.html
new file mode 100644
index 0000000000..8e464d8ce3
--- /dev/null
+++ b/home/default_platform_document/template_thumb/index.html
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/home/default_platform_document/learnerwonder.gif b/home/default_platform_document/template_thumb/learnerwonder.gif
similarity index 100%
rename from home/default_platform_document/learnerwonder.gif
rename to home/default_platform_document/template_thumb/learnerwonder.gif
diff --git a/home/default_platform_document/leftlist.gif b/home/default_platform_document/template_thumb/leftlist.gif
similarity index 100%
rename from home/default_platform_document/leftlist.gif
rename to home/default_platform_document/template_thumb/leftlist.gif
diff --git a/home/default_platform_document/leftrightlist.gif b/home/default_platform_document/template_thumb/leftrightlist.gif
similarity index 100%
rename from home/default_platform_document/leftrightlist.gif
rename to home/default_platform_document/template_thumb/leftrightlist.gif
diff --git a/home/default_platform_document/noimage.gif b/home/default_platform_document/template_thumb/noimage.gif
similarity index 100%
rename from home/default_platform_document/noimage.gif
rename to home/default_platform_document/template_thumb/noimage.gif
diff --git a/home/default_platform_document/phasetimeline.gif b/home/default_platform_document/template_thumb/phasetimeline.gif
similarity index 100%
rename from home/default_platform_document/phasetimeline.gif
rename to home/default_platform_document/template_thumb/phasetimeline.gif
diff --git a/home/default_platform_document/rightlist.gif b/home/default_platform_document/template_thumb/rightlist.gif
similarity index 100%
rename from home/default_platform_document/rightlist.gif
rename to home/default_platform_document/template_thumb/rightlist.gif
diff --git a/home/default_platform_document/stopthink.gif b/home/default_platform_document/template_thumb/stopthink.gif
similarity index 100%
rename from home/default_platform_document/stopthink.gif
rename to home/default_platform_document/template_thumb/stopthink.gif
diff --git a/home/default_platform_document/table.gif b/home/default_platform_document/template_thumb/table.gif
similarity index 100%
rename from home/default_platform_document/table.gif
rename to home/default_platform_document/template_thumb/table.gif
diff --git a/home/default_platform_document/video.gif b/home/default_platform_document/template_thumb/video.gif
similarity index 100%
rename from home/default_platform_document/video.gif
rename to home/default_platform_document/template_thumb/video.gif
diff --git a/home/default_platform_document/yourinstructor.gif b/home/default_platform_document/template_thumb/yourinstructor.gif
similarity index 100%
rename from home/default_platform_document/yourinstructor.gif
rename to home/default_platform_document/template_thumb/yourinstructor.gif
diff --git a/main/admin/settings.php b/main/admin/settings.php
index 9f3505862a..71336d792b 100644
--- a/main/admin/settings.php
+++ b/main/admin/settings.php
@@ -1,4 +1,4 @@
-';
+		return '
';
 	}
 	else
 	{
-		return '
';
+		return '
';
 	}
 }
 
@@ -1051,14 +1051,14 @@ function add_edit_template()
 		// adding an extra field: a hidden field with the id of the template we are editing
 		$form->addElement('hidden','template_id');
 		
-		// adding an extrra field: a preview of the image that is currently used
+		// adding an extra field: a preview of the image that is currently used
 		if (!empty($row['image']))
 		{		
-			$form->addElement('static','template_image_preview', '', '
');
+			$form->addElement('static','template_image_preview', '', '
');
 		}
 		else
 		{
-			$form->addElement('static','template_image_preview', '', '
');
+			$form->addElement('static','template_image_preview', '', '
');
 		}
 		
 		// setting the information of the template that we are editing 
@@ -1089,7 +1089,7 @@ function add_edit_template()
 				$new_file_name = add_ext_on_mime(stripslashes($_FILES['template_image']['name']), $_FILES['template_image']['type']);	
 				
 				// upload dir
-				$upload_dir = api_get_path(SYS_PATH).'home/default_platform_document/';
+				$upload_dir = api_get_path(SYS_PATH).'home/default_platform_document/template_thumb/';
 				
 				// create dir if not exists
                 if (!is_dir($upload_dir)) {
@@ -1179,7 +1179,7 @@ function delete_template($id)
 	$row = Database::fetch_array($result);	
 	if (!empty($row['image']))
 	{
-		unlink(api_get_path(SYS_PATH).'home/default_platform_document/'.$row['image']);
+		unlink(api_get_path(SYS_PATH).'home/default_platform_document/template_thumb/'.$row['image']);
 	}
 	
 	// now we remove it from the database
diff --git a/main/inc/lib/fckeditor/fcktemplates.xml.php b/main/inc/lib/fckeditor/fcktemplates.xml.php
index 77464b0361..5076e55537 100644
--- a/main/inc/lib/fckeditor/fcktemplates.xml.php
+++ b/main/inc/lib/fckeditor/fcktemplates.xml.php
@@ -93,9 +93,9 @@ function load_platform_templates() {
 	$result = api_sql_query($sql, __FILE__, __LINE__);
 	while ($row = Database::fetch_array($result)) {
         if (!empty($row['image'])) {
-            $image = api_get_path(WEB_PATH).'home/default_platform_document/'.$row['image'];
+            $image = api_get_path(WEB_PATH).'home/default_platform_document/template_thumb/'.$row['image'];
         } else {
-            $image = api_get_path(WEB_PATH).'home/default_platform_document/empty.gif';
+            $image = api_get_path(WEB_PATH).'home/default_platform_document/template_thumb/empty.gif';
         }        
       	$row['content'] =  str_replace('{CSS}',$css, $row['content']);
       	$row['content'] =  str_replace('{IMG_DIR}',$img_dir, $row['content']);
@@ -159,7 +159,7 @@ function load_personal_templates($user_id=0) {
 		{
 			$image = api_get_path(WEB_CODE_PATH).'upload/template_thumbnails/'.$row['image'];
 		} else {			
-			$image = api_get_path(WEB_PATH).'home/default_platform_document/noimage.gif';
+			$image = api_get_path(WEB_PATH).'home/default_platform_document/template_thumb/noimage.gif';
 		}
 		
 		
@@ -178,7 +178,7 @@ function load_empty_template()
 {
 	global $css;			
 	?>
-
+
     
     
 	    '))
-		{
-			//ignore the line
-			$ignore = true;
-		}
-		if(!$ignore)
-		{
-			fwrite($fh,$line);
-		}
-	}
-	if(!$found_version)
-	{
-		fwrite($fh,'$_configuration[\'dokeos_version\'] = \''.$new_version.'\';'."\r\n");
-	}
-	if(!$found_stable)
-	{
-		fwrite($fh,'$_configuration[\'dokeos_stable\'] = '.($new_version_stable?'true':'false').';'."\r\n");		
-	}
-	fwrite($fh,'?>');
-	fclose($fh);	
-	
-	$sys_course_path = $pathForm.'courses/';
-	
-	//$tbl_course = Database :: get_main_table(TABLE_MAIN_COURSE);
-	//linking
-	$link = mysql_connect($dbHostForm, $dbUsernameForm, $dbPassForm);
-	mysql_select_db($dbNameForm,$link);
-	$db_name = $dbNameForm;
-	$sql = "SELECT * FROM $db_name.course";
-	error_log('Getting courses for files updates: '.$sql,0);
-	$result=mysql_query($sql);
-	
-	$perm = api_get_setting('permissions_for_new_directories');
-	$perm = octdec(!empty($perm)?$perm:'0770');
-	$old_umask = umask(0);
-	
-	
-	while($courses_directories=mysql_fetch_array($result))
-	{		
-		$currentCourseRepositorySys = $sys_course_path.$courses_directories['directory'].'/';
-		
-		$db_name = $courses_directories['db_name'];
-		$origCRS = $updatePath.'courses/'.$courses_directories['directory'];
-
-		if(!is_dir($origCRS)){
-			error_log('Directory '.$origCRS.' does not exist. Skipping.',0);
-			continue;
-		}
-		//move everything to the new hierarchy (from old path to new path)
-		error_log('Renaming '.$origCRS.' to '.$sys_course_path.$courses_directories['directory'],0);
-		rename($origCRS,$sys_course_path.$courses_directories['directory']);
-		error_log('Creating dirs in '.$currentCourseRepositorySys,0);
-	
-		//DOCUMENT FOLDER
-
-        //document > shared_folder
-        if(!is_dir($currentCourseRepositorySys."document/shared_folder")){
-            mkdir($currentCourseRepositorySys."document/shared_folder",$perm);
-        }
-
-		//UPLOAD FOLDER
-
-		//upload > forum > images
-		if(!is_dir($currentCourseRepositorySys."upload/forum/images")){
-			mkdir($currentCourseRepositorySys."upload/forum/images",$perm);
-		}
-
-		//upload > learning_path
-		if(!is_dir($currentCourseRepositorySys."upload/learning_path")){
-			mkdir($currentCourseRepositorySys."upload/learning_path",$perm);
-		}	
-
-		//upload > learning_path > images
-		if(!is_dir($currentCourseRepositorySys."upload/learning_path/images")){
-			mkdir($currentCourseRepositorySys."upload/learning_path/images",$perm);
-		}		
-
-		//upload > calendar 
-		if(!is_dir($currentCourseRepositorySys."upload/calendar")){
-			mkdir($currentCourseRepositorySys."upload/calendar",$perm);
-		}	
-
-		//upload > calendar > images
-		if(!is_dir($currentCourseRepositorySys."upload/calendar/images")){
-			mkdir($currentCourseRepositorySys."upload/calendar/images",$perm);
-		}
-	}
-}
-else
-{
-	echo 'You are not allowed here !';
-}
-?>
+'))
+		{
+			//ignore the line
+			$ignore = true;
+		}
+		if(!$ignore)
+		{
+			fwrite($fh,$line);
+		}
+	}
+	if(!$found_version)
+	{
+		fwrite($fh,'$_configuration[\'dokeos_version\'] = \''.$new_version.'\';'."\r\n");
+	}
+	if(!$found_stable)
+	{
+		fwrite($fh,'$_configuration[\'dokeos_stable\'] = '.($new_version_stable?'true':'false').';'."\r\n");		
+	}
+	fwrite($fh,'?>');
+	fclose($fh);	
+	
+	
+	$perm = api_get_setting('permissions_for_new_directories');
+	$perm = octdec(!empty($perm)?$perm:'0770');
+	$old_umask = umask(0);
+	
+	////create a specific directory for global thumbails
+	//home > default_platform_document > template_thumb
+	if(!is_dir($pathForm.'home/default_platform_document/template_thumb')){
+		mkdir($pathForm.'home/default_platform_document/template_thumb',$perm);
+	}
+	
+}
+else
+{
+	echo 'You are not allowed here !';
+}
+?>