For some reason, maybe it came from the EU, I got the impression that the dianoga was highly compressible, like a squid or octopus. It does seem to go away right before the walls start closing in so that explanation makes sense too. I originally had idea that the Force had something to do with it letting Luke go.