For few products images are visible but for some products images are not visible. After spending few hours i found that for the products whose images are missing is because their images are not getting cached, i cross checked the cache directory under
Images are not getting cached for few products only and for others images gets cached.
777 permission is given to all media directories. These products are created programmatically