I need to add code to includes/templates/mytemplate/common/html_header.php for use with a third party tool. It will be similar to the below.

Code:
<?php 
  if (isset($_GET['products_id'])) { 
  	?>
	<meta name="thumbnail" content="<?php echo $products_image; ?>" />
	<?php
  }
?>
As it's in the <head> of the page, it is before the image functions and variables have been require()d. How should I determine the image filename?

Also, the if() statement is checking to see if it's a product page. I only need to do this on product pages, at least for now. Is there a better way of checking to see if it's a product page?