function wt_masonry_sort_icons( $heading, $config ) {

    $icon_height = 40; // Set the size once for all icons 37889

    $thumbs = array(
		'all'   		=> 37889,
        'allgemein'   	=> 53363,
        'grafik'      	=> 30813,
        'telemedizin' 	=> 39339,
        'webdesign'   	=> 41445,
    );

    $css = '<style>#top div.container .av-masonry, #top div.container .av-masonry .av-masonry-sort { overflow: visible; }';

    foreach ( $thumbs as $slug => $attachment_id ) {
        $img = wp_get_attachment_image_src( $attachment_id, 'medium' );
        if ( ! $img ) continue;

        list( $url, $img_w, $img_h ) = $img;

        $width   = round( $icon_height * ( $img_w / $img_h ) );
        $padding = $width + 10;

        $css .= ".{$slug}_sort_button .inner_sort_button{position:relative;padding-left:{$padding}px;} .{$slug}_sort_button .inner_sort_button:before{content:'';position:absolute;left:5px;top:50%;transform:translateY(-50%);width:{$width}px;height:{$icon_height}px;background:url('{$url}') center/contain no-repeat;}";
    }

    $css .= '</style>';
    return $heading . $css;
}
add_filter( 'avf_masonry_sort_heading', 'wt_masonry_sort_icons', 10, 2 );