Spain called out for detaining 2,000 migrants on pier