A Reinforcement Learning Algorithm for Automated Detection of Skin Lesions