MediaFile#dimensions is called twice - in #width and in #height but it only works on the first call because the file is read to the end and consumed the first time so when #read is called the second time it only returns the empty string