Depending on the theme, Shopify menus can be set up to look good with mega menus, but it is recommended to display thumbnails in normal menus as well, as this will increase the convenience of users. This is a method to get the image URL from the menu element object (link.links) and display a thumbnail.
Example of displaying images in a menu

Among the things that can be set in the menu, images can only be displayed in "Collections," "Products," and "Blog Posts."

Example code to reference collection and product images set in links

