Bug1028359-[Gallery]-Fix of flickering edit effects image buttons for high resolution images

If the edited image is really small, then this will reduce the size too much...
How about something like:

  sampleSize = Downsample.areaNoMoreThan(window.innerWidth/5 * 50 * window.devicePixelRatio * window.devicePixelRatio / (metadata.width * metadata.height)) // assumes buttons are 50px high.