Redirect optipng output in tests/settings.py to /dev/null.
Make TemporaryStorage backend's location less random.
Refactored some logic for better separation of concerns and testability.