function getImageObject(filename, addHash = true) {
  const exists = fs.existsSync(filename);
  const size = exists ? fs.statSync(filename).size : 0;

  if (size > 0) {
    const image = PNG.sync.read(fs.readFileSync(filename));
    const hash = addHash !== false ?
      createHash('sha1').update(image.data).digest('base64') : undefined;

    return {
      path: filename,
      image,
      hash,
      height: image.height,
      width: image.width,
    };
  }

  return false;
}
Create object containing `image`, `path`, `width`, `height` and `hash`
property based on an image file.

Returns false if file does not exist.

@param {string} filename - Path to image to read
@param {boolean} addHash - Add hash to result