Replace image.preventREClose() with reuseREs()

This keeps the creation and closing of REs in sync. We only close an RE if we created it.
webgateway _get_prepared_image() uses img.reuseREs()