Page Layout is not designed to have web components. This is not an error or fault. It is done purposely.
Page Layout is the area of CSB that allows you to define your page colors, link colors, font size and type, background colors, borders, etc that are GLOBAL in nature. In other words, changing the PAGE LAYOUT should** also change several pages at one time. (** unless you have UNLOCKED static text areas on individual web pages). The Page Layout function allows you to insert common information to all pages within a limited function.
What code are you trying to insert?
Did you make a gallery page outside of CSB?
And now want to have it show up in your CSB web page?
You could use a CONTAINER PAGE for this instead.
Take a look at this tutorial for some information on how to use the container page for this function. Refers to Trellix, but it is the same as CSB for this... You would store your images as captured resource.
OR you can upload your webpage and images directly to your website using FTP (changing NO CODE) and just use a URL style link in your CSB page to open your special gallery page.