diff --git a/api.go b/api.go
index 77bcd1a8ae21922f4b26918da91629243e2844ad..f199baecd2ad97621e1cb65406041f6f181e4e63 100644
--- a/api.go
+++ b/api.go
@@ -335,7 +335,7 @@ func registerAPI() {
 	router.GET(api.ImageFile, func(context *gin.Context) {
 		flake := context.Param("flake")
 		image, data := instance.ImageData(instance.ImageSnowflakeHash(flake), false)
-		if image.Snowflake == flake {
+		if image.Snowflake != flake {
 			context.JSON(http.StatusNotFound, api.Error{Error: "not found"})
 			return
 		}
@@ -345,7 +345,7 @@ func registerAPI() {
 	router.GET(api.ImagePreview, func(context *gin.Context) {
 		flake := context.Param("flake")
 		image, data := instance.ImageData(instance.ImageSnowflakeHash(flake), true)
-		if image.Snowflake == flake {
+		if image.Snowflake != flake {
 			context.JSON(http.StatusNotFound, api.Error{Error: "not found"})
 			return
 		}