Magento : Get All Product Images, thumbnail

In this code we get all product images like thumbnail etc.
Firstly load product ID then get media gallery image and check with if condition image are found or not, Then use foreach loop and img tag print all image.


Here is full code....
<?php $img = Mage::getModel('catalog/product')->load($_product->getId())->getMediaGalleryImages();?>
<?php if($img){ ?>
   <?php $i=0; foreach($img as $_images)
     {
$i++; ?>
      <img src="<?=$this->helper('catalog/image')->init($_product, 'thumbnail', $_images->getFile())->resize(200, 130); ?>" width="200" height="130" alt="<?=$this->htmlEscape($_images->getLabel());?>" title="<?=$this->htmlEscape($_images->getLabel());?>" />
      
 <?php }
       }
  ?>


Labels: