sergey_privacy,
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<style>
img{
width: 50px;
height: 50px;
float: left;
padding: 15px;
margin: 5px;
}
.thumb{border:5px dotted red}
</style>
</head>
<body>
<img src="aaa" name="image1" id="image1" class="images">
<img src="yyy" name="image999" id="image999" class="images">
<img src="zzz" name="image1000" id="image1000" class="images">
<script>
// $(".images").addClass("thumb");
$('[id ^= image]').addClass("thumb");
</script>
</body>
</html>