Fixed attachment counts for values greater than 25, and ensured correct sizing for fewer than 5 attachments