Optimizes and updates images