Making image_id exception more general