def pop_from_queue(self, dryrun=False):
    files = os.listdir(self.queue)
    files.sort()
    file = files[0]
    filepath = os.path.join(self.queue, file)
    imagefile = open(filepath, 'rb')
    imagedata = imagefile.read()
    print('Loaded data from', filepath)
    if (not dryrun):
        os.remove(filepath)
        print('Removed', filepath)
    else:
        print('Dry run, did not remove', filepath)
    return imagedata
def pop_from_queue(self, dryrun=False):
    files = os.listdir(self.queue)
    files.sort()
    file = files[0]
    filepath = os.path.join(self.queue, file)
    imagefile = open(filepath, 'rb')
    imagedata = imagefile.read()
    print('Loaded data from', filepath)
    if (not dryrun):
        os.remove(filepath)
        print('Removed', filepath)
    else:
        print('Dry run, did not remove', filepath)
    return imagedata