Baseline JPEG decoder

Uses a slow implementation of idct from the spec.
Fails on invalid input