Your frames page would have the one side calling the applet.
The other side would call your gallery. The path to your gallery is yourdomain.tld/yourgallery/index.php
You can not set up a html file to include the gallery because HTML will not call php files.
For example your frames page is called frames.html
Your applet page is called applet.html
and your galley is called like above
<frameset rows="65%,*">
<frame name="top" src="yourdomain.tld/yourgallery/index.php" scrolling="auto">
<frame name="bottom" src="applet.html">
<noframes>
That code has the applet at the bottom with the gallery at the top. You just have to define the path to your gallery and of course the proper name of your applet page. The top half (gallery half) covers 65% of the page and the applet covers 45% of the page. To change this just edit where you see the "65%".
Make sure you do not set a html page to call the yourgallery/index.php page as it will not work and you will get the results you had before.
If you need more help please provide your URL and I will look into it more when I get time.