What may cause Undefined index in drupal_retrieve_form when uploading an image?
You need to either move hero_block_search_box_edit_form() from hero_block_search_box.inc to your .module file, or at the top of your form definition (or hook_form_alter() if that's what you are using), you need to add the following:

form_load_include($form_state, 'inc', MODULENAME, 'hero_block_search_box');


where MODULENAME is the module key (machine name) of your module. Make sure you don't include the .inc in the last parameter - I didn't forget it, I left it out on purpose.