Improving Diagnostic Performance on Small and Imbalanced Datasets Using Class-Based Input Image Composition