refactor image policy test