Change the URL of an image from wp_get_attachment_image_src except in the frontpage

This is the code I used that is working, but I want it to work only on product posts and not on the frontpage.

function alterImageSRC($  image, $  attachment_id, $  size, $  icon){         $  image[0] = 'http://newimagesrc.com/myimage.jpg';  return $  image; } add_filter('wp_get_attachment_image_src', 'alterImageSRC', 10, 4);