How do i get the number of images in mp_product.php?

I want to return the number of images that are attached to a product. I will be using the code in mp_product.php.