I just added the given code into function.php at child theme. I did not change anything in product-image.php It works perfectly now. Is that any issue if it is working like that?
Or do i need to replace the woocommerce_product_thumbnails with the woocommerce_after_single_product_summary in product-image.php to make it work properly?
Thank you.