teacher gallery to php