I added the code to update the product images programmatically.
Please refer the below code
$firstProduct = Mage::getModel ('catalog/product')
->load($firstProductId);
$firstProduct->setMediaGallery (array('images'=>array (), 'values'=>array ()))
->addImageToMediaGallery(
$filePath,
array('image','thumbnail'),
false,
false
);
$firstProduct->save();
/*debug*/
$mediaGallery = $firstProduct->getMediaGallery();
print_r($mediaGallery);
My doubt here is, how to set added image as base image.
Thank you for your valuable inputs