I received the same error and I checked my gallery settings and the width and height were not set to 0. However, I simply clicked update on the woocommerce->settings->’dynamic gallery’ page, and reloaded the front page and the problem went away.
Someone else may find this helpful