Add container div to gallery using post_gallery

Posted: asked May 18 at 12:07 - Source : stackoverflow

I am trying to add a container div to the WordPress gallery, I have this so far....

function gallery_custom( $output ) {

    $return = '<div class="mydiv">';
    $return = $output;
    $return = '</div>';

    return $return;
}

add_filter( 'post_gallery', 'gallery_custom', 10, 3 );

This is not returning anything, any ideas where I am going wrong?