Please recommend from developer

hello all

please can one tell me how can i dealing with photos and videos in photo library
i don’t know how.
i use the photos framework but the problem i getting low performance for operation my app and when i get thumbNail from PHImageManager i get the low quality for the image please i tired for searching about this answer
how can i handle the videos and images in app with good quality images and app more smoothy
am wondering how apple company can catch theses thousands of images and videos without memory warning any help please

thank you