                     photoId:photoId,
                     created:photoCreated)
                 
-                references.append(photoReference)
+                album?.references.append(photoReference)
             }
             else
             {

    
    private func asyncCleanResources()
    {
        for reference:MPicturesItemReference in references
        {
            let pictureId:PictureId = reference.pictureId
            let item:MPicturesItem? = items[pictureId]
            item?.cleanResources()
        }
    }
    

            
            let photoStatus:MPhotos.Status = firebasePhoto.status
            let photoCreated:TimeInterval = firebasePhoto.created
            let albumId:AlbumId = firebasePhoto.albumId
            let album:MPhotosItem?
            
            if albumId.isEmpty
            {
                album = defaultAlbum
            }
            else
            {
                album = albumItems[albumId]
            }
            
            if photoStatus == Status.synced
            {
                if let loadedItem:MPhotosItemPhoto = self.photos[photoId]
                {
                    items[photoId] = loadedItem
