By the sounds of it, you are already in the document root of your subdomain, which is probably defined in its own virtual host (which happens to point to a subdirectory off the main domains document root).
Unfortunately, you can't internally rewrite above/outside the document root using mod_rewrite in .htaccess. In .htaccess the RewriteRule substitution takes a URL-path only, not a filesystem path. However, you can do this if you are using mod_rewrite directly in the server config. In the server config you can specify a filesystem path as the substitution (you would need to explicitly include the full path, you can't use a relative path like ../image.php).
Alternatively, in .htaccess you might be able to proxy the request from your subdomain to the maindomain using mod_proxy with mod_rewrite. However, this might still require some server configuration. For example:
RewriteRule ^feed([0-9]+)$ http://maindomain.com/image.php?id=$1 [P]