Any party taking into custody animals under the provisions of this article shall have a lien upon such animals for the damages occasioned by the trespass of such animals and for a reasonable compensation for their feed and care while in the possession of the party, if damages are recovered.