wp_set_object_terms setting only first id from array

Turns out someone had the same problem and answered their own problem here.

wp_set_object_terms not accepting variable array

Here’s my working solution for my problem:

$image_category = array_map('intval', $_POST['image_category']);
wp_set_object_terms($product->get_id(), $image_category, 'product_cat');

Hope this helps someone else. Thanks for reading.