Function to convert from jpeg to bmp