open image file in binary mode in order to copy properly