Office 365: thumbnailPhoto - Obtaining Photo Sizes from Active Directory
Office 365 customers can set the thumbnailPhoto attribute in on-premise Active Directory to have user photos synchronized to Office 365 via Directory Synchronization (DirSync). Exchange Online limits photo size to 10KB. The script sample obtains photo size from Active Directory.
This script is tested on these platforms by the author. It is likely to work on other platforms as well. If you try it and find that it works on another platform, please add a note to the script discussion to let others know.