recursive resize jpeg