Use wp_kses_hair() to get the media attributes.