diff --git a/scripts/mkimage.sh b/scripts/mkimage.sh
index c94e415fe98586204870ed68ad30fdafd91ee71e..2490a87f43cf88e5a10daabd0e51398a2350cf9a 100644
--- a/scripts/mkimage.sh
+++ b/scripts/mkimage.sh
@@ -145,7 +145,7 @@ build_profile() {
 	# Construct final image
 	local _imgid=$(echo -n $_my_sections | sort | checksum)
 	DESTDIR=$WORKDIR/image-$_imgid-$ARCH-$PROFILE
-	if [ "_$dirty" = "yes" -o ! -e "$DESTDIR" ]; then
+	if [ "$_dirty" = "yes" -o ! -e "$DESTDIR" ]; then
 		msg "Creating $output_filename"
 		if [ -z "$_simulate" ]; then
 			# Merge sections
@@ -160,7 +160,7 @@ build_profile() {
 		fi
 	fi
 
-	if [ "_$dirty" = "yes" -o ! -e "$output_filename" ]; then
+	if [ "$_dirty" = "yes" -o ! -e "$output_filename" ]; then
 		# Create image
 		output_format="${image_ext//[:\.]/}"
 		create_image_${output_format} || _fail="yes"