That engine is FILTHY, That is a LOT of gunk in the crankcase. Did you clean the carburetor? They need to be cleaned just like a atv/snowmobile or any other type of carb. Also, in the picture it appears to me that the carburetor is not fully seated. It looks like theres a gap between the carb body o ring and the case
If you've checked all that, and the engine still fires but doesnt stay running, try either turning the idle up or leaning out the low speed slightly, or both. You can also try holding the throttle slightly open and see if that keeps it running. (An easy way to tell if its just your idle too low)