Fix API: Swap image width/height, make replies an integer, fix original filename

In the API, image width and height were swapped, the replies field was a number when it was 0 and string otherwise and the filename field contained the same as the tim field instead of the original filename.