Ahh sorry for misleading you.
3. How to integrate your own HTML into TWG
If you don't want to include TWG into an existing page but add an additional footer or header to the gallery simply create a file called header.htm and/or footer.htm and store them into the main directory (where the index.php is located). The header/footer is included in a <tr><td> </td></tr> of the main table. They also have styles assigned: twg_headerhtml, twg_footerhtml
You can also create a file named overview.htm/thumb.htm and/or image.htm. The code you place in there is added on the overview/thumb/image page below the main content. You can e.g. add a random image there
. These files are included in a <tr><td> </td></tr> of the main table. They also have styles assigned: twg_overviewhtml, wg_thumbhtml, twg_imagehtml
This is from the howto. So, try to place your adsense code in index.php and see if it runs.