CSP1150 A1: now checks if mandelbrot calculated first before displaying image