I would recommend to use LDAP_READ instead of LDAP_SEARCH and you will see thumbnail photo should be available in a convenient form to be from “XSTRING”.
LDAP_SEARCH is mentioned as obsolete in SAP documentation. To see full documentation of this FM, you can use T-code SE37 to open Function Builder. Navigate to Goto ->Documentation -> Function Module Documentation.
Function Module: LDAP_READ
Function Group: FSLDAP_EXT
Program Name: SAPLFSLDAP_EXT
INCLUDE Name: LFSLDAP_EXTU01