Override img class in gallery

You should add !important to your styles in order to override it. Better way to do this is to copy the .img-responsive styles from the Bootstrap CSS file and apply these styles to your desired HTML element instead of adding a class using PHP.

img.attachment-large {
    display: block;
    max-width: 100%;
    height: auto;
}

Or target the element by the parent element if the class is not constant.

OR use this filter.

function my_image_class_filter( $classes ) {
    return $classes.' attachment-large';
}
add_filter( 'get_image_tag_class', 'my_image_class_filter' );`