How to display all available image sizes in the media dialog



add_filter('image_size_names_choose','myfunc_mustbeuniquename_showsizes', 11, 1);

function myfunc_mustbeuniquename_showsizes($sizes)
{
    $all_sizes = array();
	     
    $added_sizes = get_intermediate_image_sizes();
     
    foreach( $added_sizes as $key => $value) {
        $all_sizes[$value] = $value;
    }
     
    // merge old and new
    $all_sizes = array_merge( $all_sizes, $sizes );
     
    return $all_sizes;
}