You could give the image an id so only the image's opacity is lower
#img{ opacity: 85%; }
<img src="http://placehold.it/300x300" id="img" />
Or you could use a class
.img{ opacity: 85%; }
<img src="http://placehold.it/300x300" id="img" />
So then your could would be something like this:
<div class="gallery">
<div class="message">
Welcome to image gallery
</div>
<img src="http://placehold.it/300x300" class="img"/>
</div>
#img{ opacity: 85%; }
.img{ opacity: 85%; }
.message {
position:absolute;
left:10px;
top:20px;
height:30px;
width:140px;
background:#333;
}
Hope this helps you! Demo