How to Hide the "Image Gallery" Admin Menu

function plt_hide_3d_image_gallery_menus() {
	//Hide the "Tools → Image Gallery" menu.
	remove_submenu_page('tools.php', '3d-image-gallery-dashboard');
}

add_action('admin_menu', 'plt_hide_3d_image_gallery_menus', 11);

Where do I put this code?