gallery and device.js