To check if it is a JPEG, you will have to know the mimetype. JPEGs use the mimetype "image/jpeg". Whenever you use a file field in a form, the mimetype is sent along as ${name}_type. To check if something is a jpeg, you will use a conditional statement like so (from this point on, I will assume the field's name as "img"):
if ($img_type == "image/jpeg") {}
To check if it is exactle 300 by 300, you'll have to use some image functions from the GD library (http://www.boutell.com/gd/). As you probably know, images work on grids of x and y. X is the horizontal, or width, and, in contrast, y is the vertical, or height. imagesx() will get the x value for the highest pixel, and imagesy() will get the y value for the highest pixel. This allows you to get the width and the height. These can be stored in variables like this:
$width = imagesx($im);
$height = imagesy($im);
$im is the image in memory, meaning you will have to load it via imagecreatefromjpeg(), which also means you will have to copy it to a place it can be read. Then, if it's not 300 by 300 pixels, delete it.
To resize an image, you will have to create a 100 by 100 pixel image, and copy the image over. You can do this with functions already built into GD:
$thumb = imagecreate(100,100);
imagecopyresized($thumb,$im,0,0,0,0,100,100,$width,$height);
imagejpeg($thumb,"t_".$img_name);
imagedestroy($thumb);
This will copy over the image to a newly created 100 by 100 pixel image, and save it as "t_{name}", where {name} is the name of the file on the remote computer.