User page tab with node edit, file upload image widget not working On every user profile page i have a tab My company its a node edit form of content type Company. Here the code:

/**
 * Implementation of hook_menu().
 */
function feature_directory_section_menu(){
  $items = array();

  $items['user/%user/company'] = array(
    'title' =&gt; 'My company',
    'page callback' =&gt; 'feature_directory_section_user_company',
    'page arguments' =&gt; array(1),
    'access callback' =&gt; 'feature_directory_section_access_user_company',
    'access arguments' =&gt; array(1),
    'type' =&gt; MENU_LOCAL_TASK,
    'weight' =&gt; 10,
  );

  return $items;
}
//callback function
function feature_directory_section_user_company($account) {
  $uid = is_object($account) ? $account-&gt;uid : (int) $account;
  module_load_include('inc', 'node', 'node.pages');
  $output = '';
  $nid = db_query("SELECT n.nid FROM {node} n WHERE n.uid = :uid", array(':uid'=&gt; $uid))-&gt;fetchField();

  if (is_numeric($nid)) {
    $output = node_page_edit(node_load($nid));
  } else {
    $output = t('You have no company. Please contact the site administrator.');
  }

  return $output;
}


Content type company has alot of fields, when i trying to edit node on user/%user/company page everything works fine, but one thing not working its ajax image upload or i can't delete image of my field(field_company_gallery) - its just a image field and u can upload unlimited count of images. 

I get a lot of errors. If i go to node/%nid/edit i can manage images. but on user profile tab i can't.

Some errors are next:

Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'node_form' not found or invalid function name in drupal_retrieve_form() (line 798 of /home/www/buildit/htdocs/includes/form.inc).
Notice: Undefined index: #node in comment_form_node_form_alter() (line 1194 of /home/www/buildit/htdocs/modules/comment/comment.module).


Notice: Undefined index: field_company_gallery in file_ajax_upload() (line 271 of /home/www/buildit/htdocs/modules/file/file.module).
Notice: Undefined index: #suffix in file_ajax_upload() (line 280 of /home/www/buildit/htdocs/modules/file/file.module).


I guess i need to load all the modules with this function module_load_include or maybe not, i am stuck here.
Ok i found solution:

If your node form has a file upload widget, you should add this code to hook_menu.

'file path' =&gt; drupal_get_path('module', 'node'),
'file' =&gt; 'node.pages.inc',