fixed #1: empty image sent with code 200 when camera is turned off

Solution for at least some of the cases with empty image sent with status code `200`. It is throwing an error if image has zero length.