Fix incorrect CSS class being output in product image gallery

Fix to correctly calculate $attachment_count