### ImageMagick version

7.1.1-6 Q16 x86

### Operating system

Windows

### Operating system, version and so on

22H2

### Description

I use command `convert` to resize images. In some cases, the output filename gets `-0` appended. It seems, that imagick adds ["filename reference"](https://imagemagick.org/script/command-line-processing.php#output). But the source is just an image, not PDF file. 

I noticed, this happens when I upload an example of malicious image from scenario #2 from https://dzone.com/articles/some-image-based-exploits-with-their-prevention 

But after I upload that image, it happens also with other non-malicious images uploaded.

Is it some sort of bug or am I doing something wrong?

### Steps to Reproduce

I use command `convert` to resize images. E.g.:

```
convert path/to/src.jpg -resize 100x100^ -gravity Center -crop 100x100^ path/to/src_100.jpg
```

In some cases, the output file is not `src_100.jpg`. but `src_100-0.jpg`.

I noticed, this happens when I upload an example of malicious image from scenario #2 from https://dzone.com/articles/some-image-based-exploits-with-their-prevention 

But after I upload that image, it happens also with other non-malicious images uploaded.

### Images

Image from scenario #2 from https://dzone.com/articles/some-image-based-exploits-with-their-prevention 
Incorrect filename
This is a GitHub Issue
repo:ImageMagick
owner:ImageMagick
Title : Incorrect filename
Issue date:

--- start body ---
### ImageMagick version

7.1.1-6 Q16 x86

### Operating system

Windows

### Operating system, version and so on

22H2

### Description

I use command `convert` to resize images. In some cases, the output filename gets `-0` appended. It seems, that imagick adds ["filename reference"](https://imagemagick.org/script/command-line-processing.php#output). But the source is just an image, not PDF file. 

I noticed, this happens when I upload an example of malicious image from scenario #2 from https://dzone.com/articles/some-image-based-exploits-with-their-prevention 

But after I upload that image, it happens also with other non-malicious images uploaded.

Is it some sort of bug or am I doing something wrong?

### Steps to Reproduce

I use command `convert` to resize images. E.g.:

```
convert path/to/src.jpg -resize 100x100^ -gravity Center -crop 100x100^ path/to/src_100.jpg
```

In some cases, the output file is not `src_100.jpg`. but `src_100-0.jpg`.

I noticed, this happens when I upload an example of malicious image from scenario #2 from https://dzone.com/articles/some-image-based-exploits-with-their-prevention 

But after I upload that image, it happens also with other non-malicious images uploaded.

### Images

Image from scenario #2 from https://dzone.com/articles/some-image-based-exploits-with-their-prevention 
--- end body ---
