Your query is logically wrong:
If you need all pimg_mid1
select sb.subcate_name, sum(p.qty) as totalqty,
p.pimg_mid1
from subcategory sb
join product p on p.subcate_id = sb.subcate_id
where sb.cate_id = @cate_id
group by sb.subcate_name, p.pimg_mid1
If you need one(latest) - use Max
select sb.subcate_name, sum(p.qty) as totalqty,
MAX(p.pimg_mid1) AS pimg_mid1
from subcategory sb
join product p on p.subcate_id = sb.subcate_id
where sb.cate_id = @cate_id
group by sb.subcate_name