如何从已编辑的变量加载图像?

Hello and sorry for the noobie question
Let's say i have a variable with value url

<input type="text" name="link">

Which submits the following link :

domain.com/profile/deCKfkiriCJFff 

Since the link above is not a valid img src i would like to display an image with the same source but with one slight change :

domain.com/profile/images/deCKfkiriCJFff 

^ valid image link

Use explode

$domain = 'domain.com/profile/deCKfkiriCJFff';
$exploded = explode('profile', $domain);
$validUrl =  $exploded[0].'profile/images'.$exploded[1];
echo $validUrl;