Improve image properties code.