I've commented out the final part of MatrixImporter.import_contacts for avatar importing, as it throws an error.
MatrixImporter.import_contacts