Как вариант...
<!DOCTYPE html>
<html>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=windows-1251' />
<script src='http://code.jquery.com/jquery-latest.js'></script>
<!--
<script src="https://code.angularjs.org/1.3.9/angular.min.js"></script>
<script src="https://code.angularjs.org/1.3.9/angular-route.js"></script>
<link rel='stylesheet type=text/css href=tmp.css' />
<link rel="stylesheet/less" type="text/css" href="style.less">
<script src="http://cdnjs.cloudflare.com/ajax/libs/less.js/2.5.0/less.min.js"></script>
-->
<style type='text/css'>
</style>
<script type='text/javascript'>
$(function(){
$('.test > a').each(function(){
$(this).children('img').attr('src',$(this).attr('href'));
});
});
</script>
</head>
<body>
<div class="test">
<a href="http://javascript.ru/forum/images/smilies/smile.gif">
<img src="old1" />
</a>
<a href="http://javascript.ru/forum/images/smilies/wink.gif">
<img src="old2" />
</a>
<a href="http://javascript.ru/forum/images/smilies/laugh.gif">
<img src="old3" />
</a>
</div>
</body>
</html>