Psst! Moderators! Any chance of wholly removing the time limit on editing posts in the "Code, Content and Presentation" subforum?
Didn't think so. Drat.
Are you currently on shared hosting or not? (Technically the question is whether the rule is in htaccess or config. But people with their own servers rarely need advice on htaccess files.)
The current format of your image filenames is
plus leading slash if you're in the config file. The "target" needs a [R=301] flag if you want it to be a redirect. Otherwise it defaults to 302.
The last part of the URL looks as if it's really \h but I don't think mod_rewrite supports that form. And anyway it's not likely an URL will get that far and then collapse into some other form ;) so no need to worry about the server having to backtrack.
Matter of fact: Does the /gallery/upload/ directory contain anything other than image files? If not, you don't even need to run the URL all the way to the end. Just go far enough-- starting with an opening anchor-- that you can safely say "nothing but images from here on".