Add pre-update resource listener

Fixed error when added an empty product image entity
should be if ($resource instanceof Product). You should use php-cs-fixer