Update pin.rb

Changes to fix image validation