web server 'hangs' when page size increases.

You may be short of RAM. Try using the F macro on your web page strings to leave them in progmem, like this:

client.println(F("<!DOCTYPE html>"));