Massive refactoring of reader

- refactored for readability (hopefully) and DRY fixes
- added checking for JPG files too (as opposed to just PNGs)
- updated tests
Made sure images.js supports jpg images too

also got a test image and added attribution
reduced mallard.png test image