img {
display: block;
position: relative;
min-height: 50px;
}
img:before {
content: " ";
display: block;
position: absolute;
top: -10px;
left: 0;
height: calc(100% + 10px);
width: 100%;
border: 2px dotted;
border-radius: 5px;
}
img:after {
content: " " attr(alt);
display: block;
font-style: normal;
position: absolute;
top: 5px;
left: 0;
width: 100%;
text-align: center;
padding: 0 5px;
}