Add credit check

- Also fixes type in tests
- Also only appends image post data on uploads