Optimizing media content such as image