How programmatically display the Image field before Taxonomy name in Better Exposed Filters? Third day I'm looking for a solution, but I can not find an answer.
I use Taxonomy term as a filter (Better Exposed Filters) on Views.
To Taxonomy term added a field image. How programmatically display the Image field before Taxonomy name in Better Exposed Filters?


I tried modules  taxonomy_icon, vocabulary image, taxonomy image
All of them do not provide an opportunity for filters Views to derive taxonomy terms in the form of "image taxonomy name".
I was prompted how to do it. Thanks a lot to xandeadx.

function MYMODULE_form_views_exposed_form_alter(&amp;$form, &amp;$form_state) {

foreach ($form['TAXONOMY_ELEMENT']['#options'] as $tid =&gt; &amp;$name) {
    $term = taxonomy_term_load($tid);
    $name = '&lt;img src="' . file_create_url($term-&gt;FIELD_IMAGE['und'][0]['uri']) . '" /&gt;' . $name;
  }
}


In my version TAXONOMY_ELEMENT = tid_1