Fix PIL tests, move helpers to _shared, fix widgets test