New tests for ffmpeg image

And refactoring