Reading images from an array buffer