Fail in JPEG encoder/decoder if image dimensions are not supported (we require multiples of 16).