Items from media library won’t get added to a custom taxonomy

i fixed my problem, the easy solution was to add to the args list just before the register_taxonomy :

'update_count_callback' => '_update_generic_term_count',