@register.simple_tag()
def product_first_image(product, size, method='crop'):
 all_images = product.images.all()
 main_image = (all_images[0].image if all_images else None)
 return get_thumbnail(main_image, size, method)

@ register . simple_tag ( ) def product_first_image ( product , size , method = 'crop' ) : all_images = product . images . all ( ) main_image = ( all_images [ 0 ] . image if all_images else None ) return get_thumbnail ( main_image , size , method )
returns main product image .