Use `readable-stream` package for better node 0.8 compatibility.

This patch also ensures that images are fully written and the stream
closed before resolving the promise with their filename.

Change-Id: Id6498397e359a9bed5eeee7b30648931508db201