Use formatid instead of imagesize, but realize that formatid is not precise, so that filtering by aspect ratio is still required.