Fix .length mistake and check for empty body

All tests pass now, and replay can handle images