Just override etc/view.xml file of catalog module and do changes as per below,
app/design/frontend/{Packagename}/{themename}/etc/view.xml
<?xml version="1.0"?>
<view xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/view.xsd">
<vars module="Magento_Catalog">
<!-- for product page thumbnail -->
<var name="gallery">
<var name="navdir">vertical</var>
</var>
<!-- for fullscreen thumbnail -->
<var name="fullscreen">
<var name="navdir">vertical</var>
</var>
</vars>
</view>