add combineImages function