How scaling 100% a image in a fixed area in bootstrap/ anything else?

I do something -

$count = $result->rowCount();
    echo '<div class="container">';
      $row = $result->fetch(PDO::FETCH_ASSOC);
      echo '<div class="row">';
        echo '<div class="col-sm-4">';
        echo '<div class="panel panel-primary">';
        echo '<div class="panel-body"<a href="sample.php?id="';
        echo $row['imageurl'];
        echo '"><img src="../';
        echo $row['imageurl'];
        echo '"class="img-responsive" style="width:250px;height:250px" alt="Image" id="';
        echo $row['imageurl'];
        echo '" onclick="getImageId(;"></div>';
        echo '<div class="panel-footer">';
        echo $row['name'];
        echo '</div></div></div>';

I fixed the width and height so that each image take same area. But, for this the shape of image is damaged as different image have different width:height ratio.