some image optimization and other stuff