Fix invalid images in mavlink video transmission.

This fixes some bugs with JPG-encoded mavlink video transmission:
 - Proper handling of changing packet size.
 - More correct handling of invalid/corrupted JPG images (i.e., don't show them :P )