I stuck to the left wall, and after that I was able to reach the end and get all the treasure chests.