correct initialisation of image dimensions