How to Hide NextGEN Gallery Admin Menus

function plt_hide_nextgen_gallery_menus() {
	//Hide "Imagely".
	remove_menu_page('imagely');
	//Hide "Imagely → Galleries".
	remove_submenu_page('imagely', 'imagely');
	//Hide "Imagely → Add New Gallery".
	remove_submenu_page('imagely', 'imagely&create_gallery=1');
	//Hide "Imagely → Albums".
	remove_submenu_page('imagely', 'imagely-albums');
	//Hide "Imagely → Tags".
	remove_submenu_page('imagely', 'imagely-tags');
	//Hide "Imagely → Settings".
	remove_submenu_page('imagely', 'imagely-settings');
	//Hide "Imagely → About Us".
	remove_submenu_page('imagely', 'imagely-about-us');
	//Hide "Imagely → Imagely CDN NEW".
	remove_submenu_page('imagely', 'https://www.imagely.com/cdn/?utm_source=imagely&utm_medium=admin-menu&utm_campaign=imagely-cdn&utm_content=4.0.5');
	//Hide "Imagely → Upgrade to Pro".
	remove_submenu_page('imagely', 'https://www.imagely.com/lite/?utm_source=ngg&utm_medium=adminsidebar&utm_campaign=unlockprosidebar');
}

add_action('admin_menu', 'plt_hide_nextgen_gallery_menus', 1001);

Where do I put this code?