Helper methods to write image to Media content provider and count data size