incorrectly updated previous image count
TODO: handle null response