Read in gallery from dat

Read in gallery from dat. However, I find that the decode fails.