diff --git a/pipelines/_steps/thumbnails/generate.go b/pipelines/_steps/thumbnails/generate.go
index 4fe71b0dac6c38c971c467cda74febcef4bd3802..a2ffc216324712435db535fc3dac3ea5b07f647b 100644
--- a/pipelines/_steps/thumbnails/generate.go
+++ b/pipelines/_steps/thumbnails/generate.go
@@ -61,8 +61,8 @@ func Generate(ctx rcontext.RequestContext, mediaRecord *database.DbMedia, width
 
 	// Create a DbThumbnail
 	newRecord := &database.DbThumbnail{
-		Origin:      thumbMediaRecord.Origin,
-		MediaId:     thumbMediaRecord.MediaId,
+		Origin:      mediaRecord.Origin,
+		MediaId:     mediaRecord.MediaId,
 		ContentType: thumbMediaRecord.ContentType,
 		Width:       width,
 		Height:      height,