Small refactoring and adding mkdir if directory does not exist
Adding limit feature to limit the number of images returned from the API