In the formulation you used, only the category image for category B would be used. If you want to display specific products, you would need to use add_cat_to_prod() and use specific product ids.