It used to be a box that was ticked by default and you had to deselect it. Since some time, the checkbox is gone and you click on the thumbnail (there’s some text explaining that) to deselect it, which means if it doesn’t show up, the buyer did actively not want it to show up, so the “sometimes” it ends up in the gallery is when the customer either is fine with it being shown or didn’t notice.
From the Buyer Help Center (I sometimes add this to my delivery note):
As a buyer, you can add or remove a work sample to their review. To remove the work sample, please click the ( - ) button on the work sample thumbnail while writing your review.