move this to a line above
`filePath = filePath || ((options.imgPath && options.imgPath + target + '.' + options.format)`