Comets and small planetesimals are believed to contain primordial building blocks in the form of millimeter to centimeter sized pebbles. One of the viable growing mechanisms to form these small bodies is through the streaming instability (SI) in which pebbles cluster and gravitationally collapse towards a planetesimal or comet in the presence of gas drag. However, most SI simulations are global and lack the resolution to follow the final collapse stage of a pebble cloud within its Hill radius. We aim to track the collapse of a gravitationally bound pebble cloud subject to mutual collisions and gas drag with the representative particle approach. We determine the radial pebble size distribution of the collapsed core and the impact of mutual pebble collisions on the pebble size distribution. We find that virial equilibrium is never reached during the cloud evolution and that, in general, pebbles with given Stokes number (St) collapse towards an optically thick core in a sequence from aerodynamically largest to aerodynamically smallest. We show that at the location for which the core becomes optically thick, the terminal velocity is well below the fragmentation threshold velocity. While collisional processing is negligible during cloud evolution, the collisions that do occur are sticking. These results support the observations that comets and small planetary bodies are composed of primordial pebbles in the milimeter to centimeter size range