Implemented automatic edgecropping, needs some more work though