Two things:
1) I see the function declaration, but where is the actual call? Do you have a separate block of code which calls it? I don't see you passing a height, width, target to imageResize. You get it with getimagesize, but never pass that value to the function? Also, without a function call, where is that return value going? It's going nowhere at the moment.
It looks like you're trying to accomplish something like:
PHP Code:
<img src="imgfilename" <?php imageResize($height, $width, $target); ?>>
2) You're not actually resizing the picture with this code. You are in the effect that you're causing the browser to render the picture at a shrunken size, but someone viewing the page still had to download the full size image, and then their browser shrunk it down. Changing HTML height and width tags only changes rendered size, not actual size.