How to print image url in foreach
Install Image URL Formatter and change the format to its url. To do so create a view of set of nodes, select the image as the field and change its format to URL. You can also change the format to URL in the manage display of the content type.