Improve pipeline generation
Improve pipeline generation

Fixes crashes when a bayer format is at the first position in the available gst
caps. Now other formats will be preferred unless bayer is the only available
option.

TheImagingSource/tiscamera,TheImagingSource/tiscamera,TheImagingSource/tiscamera,TheImagingSource/tiscamera