Teach me how I could create a machine learning algorithm which takes JPEG photos and helps me choose the best ones.