compress bmp image and save it as jpg