If this is a file out of the magento core api you must include this at the top
Mage::app('default');
$_helper = Mage::helper('catalog/output');
since we are finding the product with id rather than using the this it is frequent to use the above in the file
Getting the product id with get method
$_product = Mage::getModel(‘catalog/product’)->load($_productId); //load the product
optionally you could get sku even for testing purpose if youd like
getting GAllery of product object rray
and the final step is which all php developer must know about for each loop to get out ech object from an object array and showing the each object image URL
<div> <img style="margin-bottom:30px;" src="<?php echo (string)Mage::helper('catalog/image')->init($_product, 'image', $_image->getFile()); ?>" width="1366" height="728" />
<?php endforeach; ?>