cache imageid and relationid