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