you can try insert it under this line (actualy there two instances of that line):$new_images .= "</tr>\n";
i.e. something like this:$new_images .= "<tr class=\"imagerow".$row_bg_number."\"><td colspan=\"".$config['image_cells']."\">your adsense code here</td></tr>\n";
P.S. if you adsense code has quotes, make sure you add a slash infront of each of them, like so: \"