adding displayImage logic