Clinically relevant classification and retrieval of diabetic retinopathy images