images and videos reading and writing from/to photolibrary