Fix loading of encrypted images