diff --git a/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/MediaRepository.cs b/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/MediaRepository.cs index 73cb423837..ca488f8cc2 100644 --- a/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/MediaRepository.cs +++ b/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/MediaRepository.cs @@ -305,20 +305,20 @@ public class MediaRepository : ContentRepositoryBase sql = GetBaseQuery(QueryType.Single, joinMediaVersion: true) - .Where(x => x.Path == umbracoFileValue) + .Where(x => x.Path == mediaPath || (isResized && x.Path == originalMediaPath)) .SelectTop(1); ContentDto? dto = Database.Fetch(sql).FirstOrDefault();