Update handlers.py

Fixes bug rendering images on Windows.