OK, here we go again. Another poster who won't listen to me. Why do I even bother?
$800 Security Deposit plus another $400 for the dog? Was the $400 a Pet Deposit or a Pet Fee? The former is refundable, that latter is not. Did you sign a new contract reflecting this additional $400?
Painting, standard cleaning, and standard carpet cleaning is normal wear and tear and you should not be charged for these items. Landlord should only charge you what it cost in EXCESS or what his standard charges are from his vendors / maintenance staff to turn the unit. (Turn a unit means to make it market ready for a new resident). In other words, if his painter normally charges him $500 to paint a unit, your landlord should not charge you anything unless the painter has to charge above and beyond his normal painting charge. Landlord would need to document said overages.
I would ask your landlord for an itemized statement of charges (known in the business as a Final Account Statement or Statement of Deposit on Account). You should ask him for receipts of where it cost him extra to turn your apartment. Tell him if you don't get your deposit in full you are going to file a small claims case at the local court house and will ask for Treble damages (three times your Sec Dep, which is somewhat standard state to state).
And that is your remedy. If you don't get a full refund, go to the courthouse and file a small claims case against him. Doesn't cost that much; maybe $2-300 max. The clerk of courts won't fill out the paperwork for you but should at least let you know what to put and where on the forms they will give you.
But what do I know. I've only been in the business for 29-years. Last member who listened to me got a check from his landlord at the behest of the magistrate for $4K.
Should look up PA Tenant/Landlord law for specifics. Not my area of experience which is limited to Maryland, Virginia, N.C., S.C. Georgia, and Florida.