it is ok to begin reading. the point is when to stop.
because unless you send the package size (before the image data) you will never know if the image is complete.

see network-fortuneclient for an example to wait for a complete package of network data

hth