core: Avoid marking imported images as illegal when removing a guest from an import domain.

When RemoveImage fails ensure that the parent command is not a vm or template removal
command from an export domain before setting the image as illegal.

Change-Id: I08a2163caaa48f58c5f24f32483cc43d03078348
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1002664
Signed-off-by: Lee Yarwood <lyarwood@redhat.com>