As for the first requirement, I would thumbnail the image with code something like this:
$source_image = imagecreatefrompng( WWW_ROOT . 'img/' . $yourpath . '.png');
$source_imagex = imagesx($source_image);
$source_imagey = imagesy($source_image);
$dest_imagex = 200;
$dest_imagey = 200;
$dest_image = imagecreate($dest_imagex, $dest_imagey);
imagecopyresampled($dest_image, $source_image, 0, 0, 0, 0, $dest_imagex,
$dest_imagey, $source_imagex, $source_imagey);
header("Content-Type: image/png");
imagepng($dest_image, WWW_ROOT . 'img/' . "small" . $yourpath . '.png' ,9);
For the binary encoding you can use the base64 encode function in php (http://php.net/manual/en/function.base64-encode.php) If you want to send this Action Script, read up on the process at this S/O question: Send a array from PHP to AS3? - it appears that you can simply print/echo the information as an AS3 variable.
This S/O question may help you make images from base64: Create image from data-in-uri (base64-encoded PNG) in ActionScript