Fixed return image dimensions

Return tuple of None if image is not valid