mjpeg: return proper error code