Added JPEG support. Fixes #4