Fixed bug in image attribution when agent role is nil.