Hey Dalx,
you can get the Extension of the uploaded file by
substring($Attachment/Name,findLast($Attachment/Name,'.')+1)
Then you can check this extension to see if it is related to any of the image extensions, like "png or jpg"