Convert image to blob instead of writing to disk.