assign ids to images