You can override the gallery shortcode link
attribute with:
add_filter( 'shortcode_atts_gallery',
function( $out ){
$out['link'] = 'file';
return $out;
}
);
This means that even if your shortcodes are:
the gallery output will always be generated as if you used link="file"
.