put the imaging id in the file
updated to deal better with the sub ids