The core already hace a service to get the libraries on drupal 8, so I think is better to replace with it all function to the contrib module.
Also when you use image_widget_crop with libraries, the widget does not work properly.
Install libraries and image_widget_crop, create an image_style with manual_crop and use it as a widget on a field of type media, create a media, try to upload the image, and it will fail with any message in the log.
Use core library discovery service.
Active
1.0
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.