Fix rpi image building with Python 3 or Python 2