did you try the thumbnailPhoto Attribute in Active Directory for the avatars? It works for me very well and better then the jpegPhoto Attribute because it is also used for our exchange server / outlook.
All users had pictures in Outlook, but some had pictures in Spark, others not. We found out it depended on what application was used to put the pictures in Active Directory (AD). Some applications fill the thumbnailPhoto/jpegPoto with a base64 encoded value, other let AD do the encoding itself.
If you use ldapsearch on Linux e.g. you can see the difference by the AD attribute either having one or two colons after the attribute name. Two colons is correct and also works with Spark. One colon is not correct, but some applications like Outlook can automatically work around it.
Sorry for the delay but I needed to test the answer to verify it was correct.
The problem was that even though I was using the photos from our phoenbook which are already cropped to 120x150 px some of those files were much larger than 8Kb. I also found that the XEP-0153 also recommends files less than 8Kb and a size of no more than 64x64px.
I reduced the size of my pictures by using the ImageMagick command:
By reducing the file I found that it fixed nearly all of the problem photos. I still have a couple files which are bigger than 8Kb even when reduced to 64x64, but tht is just a problem of the source photo which I can fix later.
To convert the pics to lower filesize, the command “-resize 50%” in ImageMagick can help you. Maybe you can test different values for the quality of the pictures. 70-80% are good reduce factors for less quality loss.