Using my example, you'd still need to use the custom_function() JavaScript function but setting imageClickMode="OPEN_URL" would essentially take the place of your jQuery click handler (at least for clicks on the gallery images... you'd still need your own custom click handler for your regular non-gallery links).
Instead of:
<script>
function custom_function(text) {
alert(text);
}
</script>
... use:
<script>
function custom_function(parameter) {
callDinamicPage('mainContent', parameter, 'page', '');
}
</script>
You'd also need to pass the value of what would be the data-toggle attribute (in a regular non-gallery link) as a parameter in the call to the function (in the linkURL), e.g.:
linkURL="javascript: custom_function('xyz');"
(This assumes that 'xyz' is a valid data-toggle attribute for your scenario. Just change this for each linkURL as necessary.)
As I mentioned above, you'd still need to include your own custom click handler:
<script>
$('.link').click(function() {
callDinamicPage('mainContent', $(this).attr('data-toggle'), 'page', '');
});
</script>
... on your web page to handle your regular non-gallery links.