joewnhu is correct in how to solve this with oiko solution by changing the $priority variable but it would be nice to have the file link size be built into the plugin.
dFactory: you are correct there is a size setting for the gallery shortcode like the below:
[gallery size="large" link="file" ids="113,114,115,116,117"]
but the size=”large” relates to the thumbnails that the gallery displays, not the link=”file”. The WordPress gallery shortcode uses the full sized image for the “file” link.
What would be nice is in the main settings for your plugin to have a File Link drop down setting that links into all available sizes for the theme and let you select it.
Setting option with either a dropdown to select the size or a text field to enter your own image size value:
Below is where I could see it being used very easily in your plugin.
public function add_gallery_lightbox_selector($link, $id, $size, $permalink, $icon, $text)
{
$link = (preg_match('/<a.*? rel=("|\').*?("|\')>/', $link) === 1 ? preg_replace('/(<a.*? rel=(?:"|\').*?)((?:"|\').*?>)/', '$1 '.$this->options['settings']['selector'].'[gallery-'.$this->gallery_no.']'.'$2', $link) : preg_replace('/(<a.*?)>/', '$1 rel="'.$this->options['settings']['selector'].'[gallery-'.$this->gallery_no.']'.'">', $link));
/* Get the image URL and the size from the settings*/
$image = wp_get_attachment_image_src( $id, $this->options['settings']['file_link_size'] );
/* Replace the full file URL with the new sized image URL */
return (preg_match('/<a.*? href=("|\').*?("|\')>/', $link) === 1 ? preg_replace('/(<a.*? href=(?:"|\')).*?((?:"|\').*?>)/', '$1'.$image[0].'$2', $link) : preg_replace('/(<a.*?)>/', '$1 href="'.$image[0].'">', $link));
}