Hi,
ImageFolder or a custom Dataset are just two different ways to read the data from disk.
If you observe wildly different results when using one or the other, then there is a bug in some of the code.