fixed null pointers for recursion
fixed image size