well i have done it by putting the file code in my php based header.php file.
if(isset($_GET['page'])) {
$url = substr($_SERVER['REQUEST_URI'], 0, strpos($_SERVER['REQUEST_URI'], '?') );
echo '<link rel="canonical" href="http://www.yoursite.com' . $url . '" />';
}you can modify the
if(isset($_GET['page']
part and replace page with img