A Robust Framework Based on Dataset Refinement and Transfer Learning for the Recognition of Skin Lesions