Gallery handling of link parameter is a bit odd (presumably due to recursiveTagParsing and trimming things before splitting up by '|' instead of after).
Example:
<gallery> Foo.jpg|link=http://somewhere.com|caption </gallery>
Expected behaviour: Link to http://somewhere.com
Actual behaviour: Link to http://somewhere.com%2Ccaption
<gallery> Foo.jpg|link=http://somewhere.com |caption </gallery>
Expected behaviour: link to http://somewhere.com
Actual behaviour: it treats it as an internal link - http://mywiki.com/w/index.php/http://somewhere.com
I suppose if we changed this we would have to be careful over breaking back-compat(?). In particular the whole recursiveTagParse thing probably means someone is using {{!}} to split up components.