Some fixes and code-refactored on media preview functions.

Video and image functionality working and first test with audio receiving.

with this PR #163 #164 and #169 issues works well