replacing bitmap.getByteCount with manual count