Using Liquid code to create product modules

I hope to create a module on the product page of the theme through liquid code, so that the module can display the main image of the product with the same product label as the main product, and can realize product jump. The problem I encountered is that the module will display all the main images of the products. The code is as follows: