Remove BR tag from default WordPress Gallery output

WordPress adds a br tag in the default gallery output, which, in some themes may not be needed. Simply add the following function into your theme’s functions.php file.

add_filter('the_content', 'fy_neutra_gallery_break', 11, 2);
function fy_neutra_gallery_break($output) {
    return preg_replace('/<br[^>]*>/', '', $output);
}