Implement sprite vertical and horizontal flip, and fix overlapping sprite rendering