Losslessly optimize images