You'll have to separate them into two batches. I can't see any way to avoid that. What you're asking for is to separate by content, and Photoshop can't do that ("content-aware" notwithstanding).
If they already had different aspect ratios, or other properties to separate them, you could insert a conditional step. But something has to be different.
Unless someone comes up with something brilliant...