unify preview generation in media control list and form
move mime types to helper class
improve file upload validation, add max size configuration for validator