I'd definitely not recommend to rely on default text length here because for Postgresql 9 and SQlite3 it maps to SQL type TEXT which is unlimited, by in MySQL it maps to TINYTEXT, TEXT, MEDIUMTEXT, or LONGTEXT2 depending on the length given (defaults to 64 kB). Not sure about sqlite3 at all, so I'd set some reasonable maximum size - let's say its 65536 and verify against then when storing base64 encoded picture.

Which might be also maximum limit of a picture LDAP size for the Foreman setting option - it is able to calculate that as base64 is predictable encoding (I think it adds 33.3% to the original data). So we can limit the setting to that.