Interesting questions you have!
First of all, you wouldn't be breaking any laws, if you looked around / searched for answers to your questions, but anyway, I'd love to redirect you to some usefull places.
About you wanting to strip HTML-like code, you should really be taking a look at regular expressions ( or regexp ). With that you can search for variations in text and replace it with nothing or something else. ( Look at http://www.php.net/eregi_replace )
About resizing images if they are too big, you can use getimagesize() ( Look at http://www.php.net/getimagesize ) with which you can get image-width and -height plus much more. Like this :
<?php
list($image_height, $image_width, ) = getimagesize($image_file);
if ($image_width > 400) {
$image_height = ($image_height / $image_width) * 400;
$image_width = 400;
}
echo "<img src='".$image_file."' width='".$image_width."' height='".$image_height."' border='0' alt='' title=''>\n";
?>
Hope that helps? If not, ask again!