Hello,
The Images settings of the products are coming from WooCommerce, Please read the below-given articles:
https://woocommerce.com/posts/whats-new-woocommerce-3-3/
https://woocommerce.wordpress.com/2017/12/11/wc-3-3-image-size-improvements/
This is the default functionality of the WooCommerce new version as it does not provide the option to set height for the product image. It automatically resizes the image based on its width you set.
If you want to use images of 400×400 then you need to set in from Appearance >> Customize >> Product Images.
Screenshot for Clarification: https://ibb.co/k1rj5Ck
Best Regards.