Moved image loading functionality to the DataLoader class.