arahmanov,
<!DOCTYPE HTML>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script>
$(function() {
var a = $("#textarea").val(),
a = $("<div>", {
html: a
});
a.find("img").each(function(a, b) {
var c = $("<div>", {
css: {
background: "url(" + b.getAttribute("src") + ") no-repeat",
width: b.width + "px",
height: b.height + "px",
margin: b.border + "px auto"
}
});
$(b).replaceWith(c)
});
$("#textarea").val(a.html())
});
</script>
</head>
<body>
<textarea id="textarea" name="" rows="8" cols="70">
<img src="A.tip" alt="B" width="100" height="200" border="2"/>
<img src="A2.tip" alt="B2" width="123" height="345" border="4"/>
</textarea>
</body>
</html>