Fixed bugs in get piece from pixel location