I'm using Image Assist module http://drupal.org/project/img_assist to upload pictures. I've mentioned in this issue #124346: integration with other input filters what I did to get it to spit out proper wikitext.

To get it to work better I've enabled use of the image module http://drupal.org/project/image presets.

I started out modifying Image.php found in ...\modules\pearwiki_filter\pear_override\parse_mediawiki\Image.php. I added the following code:

if (module_exists('image') && function_exists('image_get_sizes')) {
			$sizes_big = image_get_sizes();
			$sizes = array();
			$idx = 0;
			foreach($sizes_big as $size) {
				$sizes[$idx++] = strtolower($size['label']);
			}
		}

on line 11. This checks for the image module and also checks that the function image_get_sizes exists. Then it converts the 2-dimensional array into a 1 dimensional array.

Further, in the foreach loop below, I added an elseif:

			  elseif (!empty($sizes) && in_array($part, $sizes)){
				$options['attr']['preset'] = $part;
			  }

This adds a new value to the $options array, the preset value. It will only add it if it is in the list of presets supplied by the image module. In my case I have the defaults of original, preview, and thumbnail, and I added small, medium, and large.

Now that the parser is updated, I've modified the renderer for images, Image.php found in ...\modules\pearwiki_filter\pear_override\render\Xhtml\Image.php. I've added the following code:

if (isset($options['attr']['preset']))
$preset = $options['attr']['preset'];
else
$preset = 'preview';
?>

on line 57. This grabs the preset value and if it's set it uses that value, otherwise it uses the default 'preview' which all images should have since it can't be changed in the image module.

Next, below that, I changed the $image = db_fetch_object(...) line to be

which limits the images grabbed to the selected preset. I am going to set up a fallback if for some reason the preset isn't present, it will still be rendered instead of a broken image.

That's really all there is to it. Quite simple. Since this module is no longer maintained I hope that someone who is still forced to use this broken filter will find this helpful.