It cannot be done strictly using Typoscript?
> tt_content.image.20.1.imageLinkWrap {
> enable.data = register:IMAGE_NUM
> enable.postUserFunc = yourWidthCheckingFunction
> }
>
> You need the register to get the position of the image in the CSV list of
> files.