Restructed the call to avformat_open_input to provide more information.
Introduced a cast(T) method into the ImageUtils template functor to allow code reading images to handle casting from source data to a form that a user can use more conviently