diff --git a/target/linux/ramips/image/Makefile b/target/linux/ramips/image/Makefile
index d700e69440ef52f1a1e0b959edc14381642ab13f..4f65583f13d228cfcc0704de14e2d764c512f285 100644
--- a/target/linux/ramips/image/Makefile
+++ b/target/linux/ramips/image/Makefile
@@ -48,7 +48,9 @@ define Device/seama
 endef
 
 define Build/jcg-header
-	$(STAGING_DIR_HOST)/bin/jcgimage -v $(1) $(if $(JCG_MAXSIZE), -m $(JCG_MAXSIZE),) -u $@ -o $@.new
+	$(STAGING_DIR_HOST)/bin/jcgimage -v $(1) \
+		$(if $(JCG_MAXSIZE), -m $$(($(subst k, * 1024,$(JCG_MAXSIZE)))),) \
+		-u $@ -o $@.new
 	mv $@.new $@
 endef
 
diff --git a/target/linux/ramips/image/mt76x8.mk b/target/linux/ramips/image/mt76x8.mk
index dbd80a60531988d18d82544adc623495ce8ed23a..758caf7fa29fd8911f6c81d5d8ed1e7beac481f1 100644
--- a/target/linux/ramips/image/mt76x8.mk
+++ b/target/linux/ramips/image/mt76x8.mk
@@ -37,7 +37,7 @@ define Device/cudy_wr1000
   IMAGES += factory.bin
   IMAGE/factory.bin := \
         $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | jcg-header 92.122
-  JCG_MAXSIZE := 8060928
+  JCG_MAXSIZE := 7872k
   DEVICE_VENDOR := Cudy
   DEVICE_MODEL := WR1000
   DEVICE_PACKAGES := kmod-mt76x2