added callback to imageExists and wsExists