added jpeg support, fixes #4