Hi @Alfapromo,
You can create a shell script that associates the first image as the base/thumbnail/small image for the product, and then run the shell script through the command-line.
Here is sample code for you:
$product = Mage::getModel('catalog/product')->load($productId);
// Get all images
$mediaGallery = $product->getMediaGallery();
// Check if there are images
if (isset($mediaGallery['images'])){
// Loop through the images
foreach ($mediaGallery['images'] as $image){
// Set the first image as the base image
Mage::getSingleton('catalog/product_action')->updateAttributes(array($product->getId()), array('image'=>$image['file']), 0);
//stop
break;
}
Always remember to create a backup before running a shell script that modifies your catalog.
Best regards.
Gabriel