Fix crash when set .gif as wallpaper

Change-Id: I215ef2a0165adaaadb05c62dee741a8ea6926144