HDFS-7158. Reduce the memory usage of WebImageViewer. Contributed by Haohui Mai.