Added cache for media_size since it was so slow