thank you Hardeep Asrani, that worked for me!!
Hi, you coul do this:
$data = get_the_category_data( $id );
$thumbnail_url = $data->sizes->thumbnail->url;
<img src="<?php echo $thumbnail_url;?>" alt=" " />
or
$data = get_the_category_data( $id );
$medium = $data->sizes->medium->url;
<img src="<?php echo $medium;?>" alt=" " />
I hope that helps you