server: Use request library instead of manual node.js http handling

Should fix corruption issue of images