Primality of polyomino ideals by quadratic Gröbner basis