select * from product_images where pi_prod_id= order by pi_default desc, pi_id limit 1