i have solutions for it , you can make 1 php script and run by command line or web browser.
the solutions is get all product gallery images, and you can choose 1st image to use for base, thumb, small.
pls contact me via skypeId: vna_typn , i can do it right now.