How to make thumbnail image fit into a div where image dimentions are completely different?

It may be that some of your images were uploaded before you created the custom image size function. If that’s the case, a plugin like Force Regenerate Thumbnails will solve your problem.

Alternatively, for more versatility you could use the images as backgrounds, like so:

<div style="background-image: url(<?php the_post_thumbnail_url(); ?>)" id="post-thumbnail"></div>

and set the background size for #post-thumbnail to cover.