fix bug about lastId
Merge pull request #5 from dmedov/add_models

fix bug lastId in ImageModel