If carpet cleaning resolves the problem, then deduct the cost of cleaning from their deposit (fully following state law on deposit deductions, notices, timing, and the refund of any remaining balance), and be grateful that they didn't have a cat.
If it turns out that carpet is damaged to the point that it needs to be replaced, you can deduct from the security deposit the depreciated value of the carpet that you need to replace. If the security deposit is exhausted before the damage is covered, then you can consider whether or not you should sue to try to recover more money. If there is a remaining balance, refund it consistent with your state's security deposit laws.
Keep copies of the pictures "just in case".

