Fix the product attachment urls when use n/%product_cat% as base url

Closes the #5159