TODO: make this a lot faster, will require rewriting drawmenu significantly
to drawimage() and cleanupimage() we don't need to call cleanupimage() as it is already called in cleanup() we don't need to call drawimage() because X11 events should handle that for us anyway