Allow PDF uploads in image upload

@jrbl & @stvstnfrd - Changes to allow PDF uploads using image upload feature.
Well, technically they don't do both; they just do it redundantly in both layers of the client-side data handling. In both cases they rely on the browser to report the MIME type correctly. But this is for an environment where users are basically trusted, too. Note that by the time someone is hitting this code, they're logged in and registered to a course.