Fix media preview in forms
Refactor media system