The purchaser, whether at tax collector’s sale or at resale by the city in the event of the city having become the purchaser, or at foreclosure sale by order of court, takes the property subject to all unpaid installments, interest and penalties under the same proceeding.