On show.php page, you may want to show different ads based on the type of images. Here is a solution for showing ads according to family safe or not images. You can insert the following code in your skin/<skin_name>/show.html with apporiate changes.

Code:
<!-- IF is_family_safe == 1 -->
Here is the ads code for 'Family safe' images, for example. 
<!-- ELSE -->
Then here is the ads code for adult images, for example. 
<!-- ENDIF -->