Handle multiple sandbox renders and fix logic error when detecting external images.