}
     break;
 case 'image_size':
     // not used
     $pos = strpos($_POST['path'], $upload_dir);
     if ($pos !== FALSE) {
         $info = getimagesize(substr_replace($_POST['path'], $current_path, $pos, strlen($upload_dir)));
         echo json_encode($info);
     }
     break;
 case 'save_img':
     $info = pathinfo($_POST['name']);
     if (strpos($_POST['path'], '/') === 0 || strpos($_POST['path'], '../') !== FALSE || strpos($_POST['path'], './') === 0 || strpos($_POST['url'], 'http://featherfiles.aviary.com/') !== 0 || $_POST['name'] != fix_filename($_POST['name'], $transliteration, $convert_spaces, $replace_with) || !in_array(strtolower($info['extension']), array('jpg', 'jpeg', 'png'))) {
         die('wrong data');
     }
     $image_data = get_file_by_url($_POST['url']);
     if ($image_data === FALSE) {
         die(lang_Aviary_No_Save);
     }
     file_put_contents($current_path . $_POST['path'] . $_POST['name'], $image_data);
     create_img($current_path . $_POST['path'] . $_POST['name'], $thumbs_base_path . $_POST['path'] . $_POST['name'], 122, 91);
     // TODO something with this function cause its blowing my mind
     new_thumbnails_creation($current_path . $_POST['path'], $current_path . $_POST['path'] . $_POST['name'], $_POST['name'], $current_path, $relative_image_creation, $relative_path_from_current_pos, $relative_image_creation_name_to_prepend, $relative_image_creation_name_to_append, $relative_image_creation_width, $relative_image_creation_height, $relative_image_creation_option, $fixed_image_creation, $fixed_path_from_filemanager, $fixed_image_creation_name_to_prepend, $fixed_image_creation_to_append, $fixed_image_creation_width, $fixed_image_creation_height, $fixed_image_creation_option);
     break;
 case 'extract':
     if (strpos($_POST['path'], '/') === 0 || strpos($_POST['path'], '../') !== FALSE || strpos($_POST['path'], './') === 0) {
         die('wrong path');
     }
     $path = $current_path . $_POST['path'];
     $info = pathinfo($path);
     $base_folder = $current_path . fix_dirname($_POST['path']) . "/";
         $_SESSION["descending"] = $ttH->get['descending'] === "true";
     }
     break;
 case 'image_size':
     $pos = strpos($ttH->post['path'], $upload_dir);
     if ($pos !== false) {
         $info = getimagesize(substr_replace($ttH->post['path'], $current_path, $pos, strlen($upload_dir)));
         echo json_encode($info);
     }
     break;
 case 'save_img':
     $info = pathinfo($ttH->post['name']);
     if (strpos($ttH->post['path'], '/') === 0 || strpos($ttH->post['path'], '../') !== FALSE || strpos($ttH->post['path'], './') === 0 || strpos($ttH->post['url'], 'http://featherfiles.aviary.com/') !== 0 || $ttH->post['name'] != fix_filename($ttH->post['name'], $transliteration) || !in_array(strtolower($info['extension']), array('jpg', 'jpeg', 'png'))) {
         die('wrong data');
     }
     $image_data = get_file_by_url($ttH->post['url']);
     if ($image_data === false) {
         die('file could not be loaded');
     }
     file_put_contents($current_path . $ttH->post['path'] . $ttH->post['name'], $image_data);
     //new thumb creation
     //try{
     create_img_gd($current_path . $ttH->post['path'] . $ttH->post['name'], $thumbs_base_path . $ttH->post['path'] . $ttH->post['name'], 122, 91);
     new_thumbnails_creation($current_path . $ttH->post['path'], $current_path . $ttH->post['path'] . $ttH->post['name'], $ttH->post['name'], $current_path, $relative_image_creation, $relative_path_from_current_pos, $relative_image_creation_name_to_prepend, $relative_image_creation_name_to_append, $relative_image_creation_width, $relative_image_creation_height, $fixed_image_creation, $fixed_path_from_filemanager, $fixed_image_creation_name_to_prepend, $fixed_image_creation_to_append, $fixed_image_creation_width, $fixed_image_creation_height);
     /*} catch (Exception $e) {
     		$src_thumb=$mini_src="";
     	    }*/
     break;
 case 'extract':
     if (strpos($ttH->post['path'], '/') === 0 || strpos($ttH->post['path'], '../') !== FALSE || strpos($ttH->post['path'], './') === 0) {
         die('wrong path');