Remove return by reference for generateThumbnails(), unnecessary and dangerous