Is it possible to create 2 dynamic pages using 1 dataset?

Hi All,
I’m working on a portfolio website for my employer.
I created a dataset collection for 30 case studies, 1 dynamic page with a photo gallery repeater and 1 Index page that display photo icons that connect to each case study (from dataset).
In those 30 case studies, some of them have videos and some do not.
What I was trying to do was, adding a video on top of gallery for the cases that have video and just having gallery shown for the cases that don’t have video ( please see attached photos), but using 1 dataset. ( and I couldn’t figure that out)

According to the photos, do I need to create 2 dynamic pages or is it possible to set dataset to show video only the cases that have video and the case that don’t have video just show gallery (positioned differently). Or do I need 2 dataset? or other ways? Please advise

Another question is that if I have 2 dynamic page or 2 dataset, how can I connect them to a gallery on the index page?

I have been doing research on this for 3 days now and still can’t figure it out.
Thank you all in advance for your help!

For those students who don’t have the video, can you just write the code to collapse the video element?

Thank you for your suggestion,
unfortunately I don’t know how to write the code. Do you have an example of the code that I could see? Thank you

Here is a sample code
Of course, you need to match the names of the values and the video object


$w.onReady(function () {
 const video = $w('#dynamicDataset').getCurrentItem().video;
   
 if (video === undefined) {
        $w('#viseo1').collapse();
    }
        })