A solution that I would appreciate:
Images that are scaled, e.g., image?200 , are usually meant to be a link to the full-size version; these should remain links.
Images that are not scaled usually need not open in a separate window, e.g. the icons on the
http://www.dokuwiki.org/toolbar page.
To avoid breaking the behavior of existing pages, a configuration option 'nolink_unscaled' (or 'link_scaled_only', ...) might be used to enable this new behavior. But I doubt that this would be needed.