change screenshot from stream to buffer to avoid 'invalid stream id' error