Integrated this into the imageSource function

for the portfolio. Much neater code.