Media failed to import..


we are creating a theme but have an import issue. When we export the XML and try to import it we get Media Failed to import for some of the images. We noticed that this happens for the images that do not have minimum width 1024px. We notice that this happens because of the media files that get created for each uploaded image. So we added this code to functions.php :

function sgr_filter_image_sizes( $sizes) {
unset( $sizes[‘thumbnail’]);
unset( $sizes[‘medium’]);
unset( $sizes[‘medium_large’]);
unset( $sizes[‘large’]);
return $sizes;
add_filter(‘intermediate_image_sizes_advanced’, ‘sgr_filter_image_sizes’);

But still we do not get the smaller images to import. We have also run the thumbnail regenerator but get the same result. What could be the issues solver here?

Thanks for the help!