Some bug fixes and switched to imagemagick npm module.