added helper functions

for converting bitmaps to byte array
for writing and loading to internal storage