Converts first part of code to use factory pattern for model instancation
Fix image model's unserialization and __init__
Fix problem when note doesn't have updated ts