Removes WordPress [gallery] embedded CSS and leave [gallery] div element id and class attributes intact.
add_filter( 'gallery_style', 'remove_gallery_style' )
function remove_gallery_style( $css ) {
preg_replace( "#<style type=\'text/css\'>(.*?)</style>#s", "", $css );
}
or
add_filter( 'use_default_gallery_style', '__return_false' );