photos model with PIL library and thumbnail creation