Why are you calling `ScaleJpeg` twice?