+ Start a Discussion

How to display an image when clicking on another image in lightning component

I have a forumula field which display a image (from Documents) based on some condition. The formula field also contains an hyper link. If we click on image(since it has an hyperlink) then it opens another image (from documents). 
How could I implement this functionality in lightning component. ?
I tried with below syntax
<ui:outputRichText   value="{!FormulaFieldValue}" />
on clcking an image it opens a heprlink value in a new tab. I would like open it as sub tab.