How to change the redirect URL of a form that's already been set in a module? I'm using the node gallery module in Drupal 6, and I'm having some trouble modifying it to suit my needs. When the manage images form is submitted, the function node_gallery_manage_images_submit is called. At the bottom of the function is this code:

$form_state['redirect'] = 'node/'. $gid;


I need to change the URL of that to 'my_url' instead of node/123. Using the form_alter I can set $form['#action'] = 'my_url'; and when the form is submitted it goes to that page. But the module does a lot of image processing before then, so I have to use the redirect after that's all done. I also tried $form_state['#redirect'] = 'my_url'; but that did nothing. Replacing $form_state with $form does nothing either. Can anyone please help me out? I'm pretty new to Drupal forms and this is the first time I've really had to work with them. I know there has to be some way to do it, I just can't figure out how.
You should be able to achieve this by adding your own submit function to the end of the submit handler array and overriding $form_state['#redirect'] there. Example code:

function mymodule_form_node_gallery_manage_images_alter(&amp;$form, &amp;$form_state) {
  $form['#submit'][] = 'mymodule_node_gallery_custom_submission';
}

function mymodule_node_gallery_custom_submission(&amp;$form, &amp;$form_state) {
  $form_state['redirect'] = 'my_url';
}