    # File lib/fog/aws/models/compute/image.rb, line 29
            def deregister(delete_snapshot = false)
              connection.deregister_image(id)

              if(delete_snapshot && root_device_type == "ebs")
                block_device = block_device_mapping.detect {|block_device| block_device['deviceName'] == root_device_name}
                @connection.snapshots.new(:id => block_device['snapshotId']).destroy
              else
                true
              end
            end