Adding wp_enqueue_media(); causes problem

There’s not enough information to really determine what is happening, but the best course of action is to make sure your code is only added to the options page, so it can’t interfere with anything on the edit page. You can use get_current_screen for that, like this:

add_action( 'current_screen', 'wpse113256_this_screen' );

function wpse113256_this_screen() {
    $current_screen = get_current_screen();
    if( $current_screen ->id === "options" ) {
        // Run your code
    }
}

You’ll have to check if the ID of your options page is actually “options”.