<!--
Thanks for opening an issue! A few things to keep in mind:

- The issue tracker is only for bugs and feature requests.
- Before reporting a bug, please try reproducing your issue against
  the latest version of Electron.
- If you need general advice, join our Slack: http://atom-slack.herokuapp.com
-->

* Electron version: 1.4.16 / 1.6.6 
* Operating system: macOS

### Expected behavior

`toBitmap` method returns proper buffer for `nativeImage` created by cropping an existing `nativeImage`

<!-- What do you think should happen? -->

### Actual behavior
The returned buffer's length is not correct, and `createBuffer` from it results in wrong image

<!-- What actually happens? -->

### How to reproduce

The repo to reproduce is https://github.com/KagamiChan/electron-quick-start/tree/nativeimage-crop (branch `nativeimage-crop`). The renderer script reads the lenna picture, crops it and reconstructs the cropped part using `toBitmap` and `createFromBuffer`:

```js
const { nativeImage } = require('electron')
const { resolve } = require('path')
const { writeFile } = require('fs')

const image = nativeImage.createFromPath(resolve(__dirname, './lena_std.png'))
const { width, height } = image.getSize()
const bufferLength = image.toBitmap().length
console.log('original image', width, height, bufferLength, width * height * 4)

const crop = image.crop({x: 20, y: 20, width: 220, height: 330})
const { width:cropWidth, height:cropHeight } = crop.getSize()
const cropLength = crop.toBitmap().length
const _cropLength = crop.getBitmap().length
console.log('cropped image', cropWidth, cropHeight, cropLength, _cropLength, cropWidth * cropHeight * 4)

writeFile(resolve(__dirname, './crop.png'), crop.toPNG(), e => {if (e) console.error(e)})

const buffer = crop.toBitmap()
const crop2 = nativeImage.createFromBuffer(buffer, {
  width: cropWidth,
  height: cropHeight,
})
const cropLength2 = crop2.toBitmap().length
const _cropLength2 = crop2.getBitmap().length
console.log('cropped and restored image', cropWidth, cropHeight, cropLength2, _cropLength2, cropWidth * cropHeight * 4)

const pngBuffer = crop2.toPNG()
writeFile(resolve(__dirname, './crop2.png'), pngBuffer, e => {if (e) console.error(e)})
```

the console log:
```
original image 512 512 1048576 1048576
cropped image 220 330 674672 674672 290400
cropped and restored image 220 330 290400 290400 290400
```

Observations:
- the nativeImage created from lenna picture gives a buffer length that equals to `width * height * 4`
- the cropped nativeImage object returns a buffer with much larger size, since a node buffer's length is the memory allocated, this could happen
- however, the reconstructed nativeImage object's content is not what we expected

crop.png (what we expect)
![crop](https://cloud.githubusercontent.com/assets/3816900/25617416/ccb851b0-2f74-11e7-8b5e-51e8beed33df.png)

crop2.png (the reconstructed)
![crop2](https://cloud.githubusercontent.com/assets/3816900/25617420/d0fc8232-2f74-11e7-87cc-40a8d59b8a47.png)

In my opinion `toBitmap` method is most suspicious but `crop` is another possibility because there's another issue (#8017) related to it

<!-- 

Your best chance of getting this bug looked at quickly is to provide a REPOSITORY that can be cloned and run.

You can fork https://github.com/electron/electron-quick-start and include a link to the branch with your changes.

If you provide a URL, please list the commands required to clone/setup/run your repo e.g.

  $ git clone $YOUR_URL -b $BRANCH
  $ npm install
  $ npm start || electron .

-->

shell/common/api/electron_api_native_image.cc
float scale_factor = GetScaleFactorFromOptions(args);
  if (scale_factor == 1.0f) {
    
    scoped_refptr<base::RefCountedMemory> png = image_.As1xPNGBytes();
    if (png->size() > 0)
      return webui::GetPngDataUrl(png->front(), png->size());
  }
  return webui::GetBitmapDataUrl(
      image_.AsImageSkia().GetRepresentation(scale_factor).GetBitmap());
}
v8::Local<v8::Value> NativeImage::GetBitmap(gin::Arguments* args) {
  float scale_factor = GetScaleFactorFromOptions(args);
  const SkBitmap bitmap =
      image_.AsImageSkia().GetRepresentation(scale_factor).GetBitmap();
  SkPixelRef* ref = bitmap.pixelRef();
  if (!ref)
    return node::Buffer::New(args->isolate(), 0).ToLocalChecked();
  return node::Buffer::New(args->isolate(),
                           reinterpret_cast<char*>(ref->pixels()),
                           bitmap.computeByteSize(), &Noop, nullptr)
      .ToLocalChecked();
}
v8::Local<v8::Value> NativeImage::GetNativeHandle(