Finish adding optimization tweaks for images