Allow PDF uploads in image upload

- expand code to allow pdf
- add lists of mime types to python and JS
- adjust js tests to be stricter and test pdf as well
- fix variable call for file uploads and studio text
- also add content type checking