diff --git a/app/src/tiles/tile.js b/app/src/tiles/tile.js
index e4370418..d4ec7f84 100644
--- a/app/src/tiles/tile.js
+++ b/app/src/tiles/tile.js
@@ -162,15 +162,15 @@ function render_tile(tileset, z, x, y, geometry_id, cb){
             path.join(__dirname, '..', 'map_styles', 'polygon.xml'),
             { strict: true },
             function(err, map){
-                if (err) {
-                    console.error(err);
-                    return
-                }
+                if (err) throw err
 
                 map.add_layer(layer)
                 const im = new mapnik.Image(map.width, map.height)
                 map.extent = bbox
-                map.render(im, cb);
+                map.render(im, {}, (err, rendered) => {
+                    if (err) throw err
+                    rendered.encode('png', cb)
+                });
             }
         )
     } catch(err) {
diff --git a/app/src/tiles/tileserver.js b/app/src/tiles/tileserver.js
index c3ef3e1c..74fbd5f1 100644
--- a/app/src/tiles/tileserver.js
+++ b/app/src/tiles/tileserver.js
@@ -55,7 +55,7 @@ function handle_tile_request(tileset, req, res) {
         if (err) throw err
 
         res.writeHead(200, {'Content-Type': 'image/png'})
-        res.end(im.encodeSync('png'))
+        res.end(im)
     })
 }
 
@@ -82,7 +82,7 @@ function handle_highlight_tile_request(req, res) {
         if (err) throw err
 
         res.writeHead(200, {'Content-Type': 'image/png'})
-        res.end(im.encodeSync('png'))
+        res.end(im)
     })
 }