Fixed bug due to sort in deleting products. Added validation for primary image